OLD | NEW |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 import '../../descriptor.dart' as d; | 1 import '../../descriptor.dart' as d; |
6 import '../../test_pub.dart'; | 2 import '../../test_pub.dart'; |
7 | |
8 main() { | 3 main() { |
9 initConfig(); | 4 initConfig(); |
10 integration('activating a Git package deactivates the hosted one', () { | 5 integration('activating a Git package deactivates the hosted one', () { |
11 ensureGit(); | 6 ensureGit(); |
12 | |
13 servePackages((builder) { | 7 servePackages((builder) { |
14 builder.serve("foo", "1.0.0", contents: [ | 8 builder.serve( |
15 d.dir("bin", [ | 9 "foo", |
16 d.file("foo.dart", "main(args) => print('hosted');") | 10 "1.0.0", |
17 ]) | 11 contents: [ |
18 ]); | 12 d.dir("bin", [d.file("foo.dart", "main(args) => print('hosted');")
])]); |
19 }); | 13 }); |
20 | 14 d.git( |
21 d.git('foo.git', [ | 15 'foo.git', |
22 d.libPubspec("foo", "1.0.0"), | 16 [ |
23 d.dir("bin", [ | 17 d.libPubspec("foo", "1.0.0"), |
24 d.file("foo.dart", "main() => print('git');") | 18 d.dir("bin", [d.file("foo.dart", "main() => print('git');")])]).crea
te(); |
25 ]) | |
26 ]).create(); | |
27 | |
28 schedulePub(args: ["global", "activate", "foo"]); | 19 schedulePub(args: ["global", "activate", "foo"]); |
29 | 20 schedulePub(args: ["global", "activate", "-sgit", "../foo.git"], output: """ |
30 schedulePub(args: ["global", "activate", "-sgit", "../foo.git"], | |
31 output: """ | |
32 Package foo is currently active at version 1.0.0. | 21 Package foo is currently active at version 1.0.0. |
33 Resolving dependencies... | 22 Resolving dependencies... |
34 + foo 1.0.0 from git ../foo.git | 23 + foo 1.0.0 from git ../foo.git |
35 Precompiling executables... | 24 Precompiling executables... |
36 Loading source assets... | 25 Loading source assets... |
37 Precompiled foo:foo. | 26 Precompiled foo:foo. |
38 Activated foo 1.0.0 from Git repository "../foo.git"."""); | 27 Activated foo 1.0.0 from Git repository "../foo.git"."""); |
39 | |
40 // Should now run the git one. | |
41 var pub = pubRun(global: true, args: ["foo"]); | 28 var pub = pubRun(global: true, args: ["foo"]); |
42 pub.stdout.expect("git"); | 29 pub.stdout.expect("git"); |
43 pub.shouldExit(); | 30 pub.shouldExit(); |
44 }); | 31 }); |
45 } | 32 } |
OLD | NEW |