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