OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_stream.dart'; | 5 import 'package:scheduled_test/scheduled_stream.dart'; |
6 import 'package:scheduled_test/scheduled_test.dart'; | 6 import 'package:scheduled_test/scheduled_test.dart'; |
7 | 7 |
8 import '../../descriptor.dart' as d; | 8 import '../../descriptor.dart' as d; |
9 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 initConfig(); | 12 initConfig(); |
13 integration("does not overwrite an existing binstub", () { | 13 integration("does not overwrite an existing binstub", () { |
14 d.dir("foo", [ | 14 d.dir("foo", [d.pubspec({ |
15 d.pubspec({ | |
16 "name": "foo", | 15 "name": "foo", |
17 "executables": { | 16 "executables": { |
18 "foo": "foo", | 17 "foo": "foo", |
19 "collide1": "foo", | 18 "collide1": "foo", |
20 "collide2": "foo" | 19 "collide2": "foo" |
21 } | 20 } |
22 }), | 21 }), |
23 d.dir("bin", [ | 22 d.dir("bin", [d.file("foo.dart", "main() => print('ok');")])]).create(
); |
24 d.file("foo.dart", "main() => print('ok');") | |
25 ]) | |
26 ]).create(); | |
27 | 23 |
28 d.dir("bar", [ | 24 d.dir("bar", [d.pubspec({ |
29 d.pubspec({ | |
30 "name": "bar", | 25 "name": "bar", |
31 "executables": { | 26 "executables": { |
32 "bar": "bar", | 27 "bar": "bar", |
33 "collide1": "bar", | 28 "collide1": "bar", |
34 "collide2": "bar" | 29 "collide2": "bar" |
35 } | 30 } |
36 }), | 31 }), |
37 d.dir("bin", [ | 32 d.dir("bin", [d.file("bar.dart", "main() => print('ok');")])]).create(
); |
38 d.file("bar.dart", "main() => print('ok');") | |
39 ]) | |
40 ]).create(); | |
41 | 33 |
42 schedulePub(args: ["global", "activate", "-spath", "../foo"]); | 34 schedulePub(args: ["global", "activate", "-spath", "../foo"]); |
43 | 35 |
44 var pub = startPub(args: ["global", "activate", "-spath", "../bar"]); | 36 var pub = startPub(args: ["global", "activate", "-spath", "../bar"]); |
45 pub.stdout.expect(consumeThrough("Installed executable bar.")); | 37 pub.stdout.expect(consumeThrough("Installed executable bar.")); |
46 pub.stderr.expect("Executable collide1 was already installed from foo."); | 38 pub.stderr.expect("Executable collide1 was already installed from foo."); |
47 pub.stderr.expect("Executable collide2 was already installed from foo."); | 39 pub.stderr.expect("Executable collide2 was already installed from foo."); |
48 pub.stderr.expect("Deactivate the other package(s) or activate bar using " | 40 pub.stderr.expect( |
49 "--overwrite."); | 41 "Deactivate the other package(s) or activate bar using " "--overwrite.")
; |
50 pub.shouldExit(); | 42 pub.shouldExit(); |
51 | 43 |
52 d.dir(cachePath, [ | 44 d.dir( |
53 d.dir("bin", [ | 45 cachePath, |
54 d.matcherFile(binStubName("foo"), contains("foo:foo")), | 46 [ |
55 d.matcherFile(binStubName("bar"), contains("bar:bar")), | 47 d.dir( |
56 d.matcherFile(binStubName("collide1"), contains("foo:foo")), | 48 "bin", |
57 d.matcherFile(binStubName("collide2"), contains("foo:foo")) | 49 [ |
58 ]) | 50 d.matcherFile(binStubName("foo"), contains("foo:foo")), |
59 ]).validate(); | 51 d.matcherFile(binStubName("bar"), contains("bar:bar")), |
| 52 d.matcherFile(binStubName("collide1"), contains("foo:foo")), |
| 53 d.matcherFile(binStubName("collide2"), contains("foo:foo"))]
)]).validate(); |
60 }); | 54 }); |
61 } | 55 } |
OLD | NEW |