blob: 3aa0ef2ec8fa4106d995cfa50d1d61a24a243940 [file] [log] [blame]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:test/test.dart';
import 'package:pub/src/validator/pubspec.dart';
import '../descriptor.dart' as d;
import '../test_pub.dart';
import 'utils.dart';
void main() {
test('should consider a package valid if it has a pubspec', () async {
await d.validPackage.create();
await expectValidation((entrypoint) => PubspecValidator(entrypoint));
test('should consider a package invalid if it has a .gitignored pubspec',
() async {
var repo = d.git(appPath, [d.file('.gitignore', 'pubspec.yaml')]);
await d.validPackage.create();
await repo.create();
await expectValidation((entrypoint) => PubspecValidator(entrypoint),
errors: isNotEmpty);