OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
1 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 |
2 import '../../lib/src/entrypoint.dart'; | 7 import '../../lib/src/entrypoint.dart'; |
3 import '../../lib/src/validator.dart'; | 8 import '../../lib/src/validator.dart'; |
4 import '../../lib/src/validator/executable.dart'; | 9 import '../../lib/src/validator/executable.dart'; |
5 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
6 import '../test_pub.dart'; | 11 import '../test_pub.dart'; |
7 import 'utils.dart'; | 12 import 'utils.dart'; |
| 13 |
8 Validator executable(Entrypoint entrypoint) => | 14 Validator executable(Entrypoint entrypoint) => |
9 new ExecutableValidator(entrypoint); | 15 new ExecutableValidator(entrypoint); |
| 16 |
10 main() { | 17 main() { |
11 initConfig(); | 18 initConfig(); |
| 19 |
12 setUp(d.validPackage.create); | 20 setUp(d.validPackage.create); |
| 21 |
13 group('should consider a package valid if it', () { | 22 group('should consider a package valid if it', () { |
14 integration('has executables that are present', () { | 23 integration('has executables that are present', () { |
15 d.dir(appPath, [d.pubspec({ | 24 d.dir(appPath, [d.pubspec({ |
16 "name": "test_pkg", | 25 "name": "test_pkg", |
17 "version": "1.0.0", | 26 "version": "1.0.0", |
18 "executables": { | 27 "executables": { |
19 "one": "one_script", | 28 "one": "one_script", |
20 "two": null | 29 "two": null |
21 } | 30 } |
22 }), | 31 }), |
23 d.dir( | 32 d.dir( |
24 "bin", | 33 "bin", |
25 [ | 34 [ |
26 d.file("one_script.dart", "main() => print('ok');"), | 35 d.file("one_script.dart", "main() => print('ok');"), |
27 d.file("two.dart", "main() => print('ok');")])]).create(); | 36 d.file("two.dart", "main() => print('ok');")])]).create(); |
28 expectNoValidationError(executable); | 37 expectNoValidationError(executable); |
29 }); | 38 }); |
30 }); | 39 }); |
| 40 |
31 group("should consider a package invalid if it", () { | 41 group("should consider a package invalid if it", () { |
32 integration('is missing one or more listed executables', () { | 42 integration('is missing one or more listed executables', () { |
33 d.dir(appPath, [d.pubspec({ | 43 d.dir(appPath, [d.pubspec({ |
34 "name": "test_pkg", | 44 "name": "test_pkg", |
35 "version": "1.0.0", | 45 "version": "1.0.0", |
36 "executables": { | 46 "executables": { |
37 "nope": "not_there", | 47 "nope": "not_there", |
38 "nada": null | 48 "nada": null |
39 } | 49 } |
40 })]).create(); | 50 })]).create(); |
41 expectValidationWarning(executable); | 51 expectValidationWarning(executable); |
42 }); | 52 }); |
43 }); | 53 }); |
44 } | 54 } |
OLD | NEW |