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