OLD | NEW |
(Empty) | |
| 1 import 'package:scheduled_test/scheduled_test.dart'; |
| 2 import '../../lib/src/entrypoint.dart'; |
| 3 import '../../lib/src/validator.dart'; |
| 4 import '../../lib/src/validator/executable.dart'; |
| 5 import '../descriptor.dart' as d; |
| 6 import '../test_pub.dart'; |
| 7 import 'utils.dart'; |
| 8 Validator executable(Entrypoint entrypoint) => |
| 9 new ExecutableValidator(entrypoint); |
| 10 main() { |
| 11 initConfig(); |
| 12 setUp(d.validPackage.create); |
| 13 group('should consider a package valid if it', () { |
| 14 integration('has executables that are present', () { |
| 15 d.dir(appPath, [d.pubspec({ |
| 16 "name": "test_pkg", |
| 17 "version": "1.0.0", |
| 18 "executables": { |
| 19 "one": "one_script", |
| 20 "two": null |
| 21 } |
| 22 }), |
| 23 d.dir( |
| 24 "bin", |
| 25 [ |
| 26 d.file("one_script.dart", "main() => print('ok');"), |
| 27 d.file("two.dart", "main() => print('ok');")])]).create(); |
| 28 expectNoValidationError(executable); |
| 29 }); |
| 30 }); |
| 31 group("should consider a package invalid if it", () { |
| 32 integration('is missing one or more listed executables', () { |
| 33 d.dir(appPath, [d.pubspec({ |
| 34 "name": "test_pkg", |
| 35 "version": "1.0.0", |
| 36 "executables": { |
| 37 "nope": "not_there", |
| 38 "nada": null |
| 39 } |
| 40 })]).create(); |
| 41 expectValidationWarning(executable); |
| 42 }); |
| 43 }); |
| 44 } |
OLD | NEW |