OLD | NEW |
1 import 'package:scheduled_test/scheduled_test.dart'; | 1 import 'package:scheduled_test/scheduled_test.dart'; |
2 import '../../descriptor.dart' as d; | 2 import '../../descriptor.dart' as d; |
3 import '../../test_pub.dart'; | 3 import '../../test_pub.dart'; |
| 4 import 'utils.dart'; |
4 main() { | 5 main() { |
5 initConfig(); | 6 initConfig(); |
6 integration("creates binstubs for each executable in the pubspec", () { | 7 integration("creates binstubs for each executable in the pubspec", () { |
7 servePackages((builder) { | 8 servePackages((builder) { |
8 builder.serve("foo", "1.0.0", pubspec: { | 9 builder.serve("foo", "1.0.0", pubspec: { |
9 "executables": { | 10 "executables": { |
10 "one": null, | 11 "one": null, |
11 "two-renamed": "second" | 12 "two-renamed": "second" |
12 } | 13 } |
13 }, | 14 }, |
14 contents: [ | 15 contents: [ |
15 d.dir( | 16 d.dir( |
16 "bin", | 17 "bin", |
17 [ | 18 [ |
18 d.file("one.dart", "main(args) => print('one');"), | 19 d.file("one.dart", "main(args) => print('one');"), |
19 d.file("second.dart", "main(args) => print('two');"), | 20 d.file("second.dart", "main(args) => print('two');"), |
20 d.file("nope.dart", "main(args) => print('nope');")])]); | 21 d.file("nope.dart", "main(args) => print('nope');")])]); |
21 }); | 22 }); |
22 schedulePub( | 23 schedulePub( |
23 args: ["global", "activate", "foo"], | 24 args: ["global", "activate", "foo"], |
24 output: contains("Installed executables one and two-renamed.")); | 25 output: contains("Installed executables one and two-renamed.")); |
25 d.dir( | 26 d.dir( |
26 cachePath, | 27 cachePath, |
27 [ | 28 [ |
28 d.dir( | 29 d.dir( |
29 "bin", | 30 "bin", |
30 [ | 31 [ |
31 d.matcherFile("one", contains("one")), | 32 d.matcherFile(binStubName("one"), contains("one")), |
32 d.matcherFile("two-renamed", contains("second")), | 33 d.matcherFile(binStubName("two-renamed"), contains("second")
), |
33 d.nothing("two"), | 34 d.nothing(binStubName("two")), |
34 d.nothing("nope")])]).validate(); | 35 d.nothing(binStubName("nope"))])]).validate(); |
35 }); | 36 }); |
36 } | 37 } |
OLD | NEW |