OLD | NEW |
| (Empty) |
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 'package:path/path.dart' as p; | |
6 | |
7 import '../../lib/src/io.dart'; | |
8 import '../descriptor.dart' as d; | |
9 import '../test_pub.dart'; | |
10 | |
11 main() { | |
12 initConfig(); | |
13 | |
14 integration('lists an activated hosted package', () { | |
15 servePackages((builder) { | |
16 builder.serve('foo', '1.0.0'); | |
17 }); | |
18 | |
19 schedulePub(args: ['global', 'activate', 'foo']); | |
20 | |
21 schedulePub(args: ['global', 'list'], output: 'foo 1.0.0'); | |
22 }); | |
23 | |
24 integration('lists an activated Git package', () { | |
25 ensureGit(); | |
26 | |
27 d.git( | |
28 'foo.git', | |
29 [ | |
30 d.libPubspec('foo', '1.0.0'), | |
31 d.dir('bin', [d.file('foo.dart', 'main() => print("ok");')])]).creat
e(); | |
32 | |
33 schedulePub(args: ['global', 'activate', '-sgit', '../foo.git']); | |
34 | |
35 schedulePub( | |
36 args: ['global', 'list'], | |
37 output: 'foo 1.0.0 from Git repository "../foo.git"'); | |
38 }); | |
39 | |
40 integration('lists an activated Path package', () { | |
41 d.dir( | |
42 'foo', | |
43 [ | |
44 d.libPubspec('foo', '1.0.0'), | |
45 d.dir('bin', [d.file('foo.dart', 'main() => print("ok");')])]).creat
e(); | |
46 | |
47 schedulePub(args: ['global', 'activate', '-spath', '../foo']); | |
48 | |
49 var path = canonicalize(p.join(sandboxDir, 'foo')); | |
50 schedulePub(args: ['global', 'list'], output: 'foo 1.0.0 at path "$path"'); | |
51 }); | |
52 | |
53 integration('lists activated packages in alphabetical order', () { | |
54 servePackages((builder) { | |
55 builder.serve('aaa', '1.0.0'); | |
56 builder.serve('bbb', '1.0.0'); | |
57 builder.serve('ccc', '1.0.0'); | |
58 }); | |
59 | |
60 schedulePub(args: ['global', 'activate', 'ccc']); | |
61 schedulePub(args: ['global', 'activate', 'aaa']); | |
62 schedulePub(args: ['global', 'activate', 'bbb']); | |
63 | |
64 schedulePub(args: ['global', 'list'], output: ''' | |
65 aaa 1.0.0 | |
66 bbb 1.0.0 | |
67 ccc 1.0.0 | |
68 '''); | |
69 }); | |
70 | |
71 integration('lists nothing when no packages activated', () { | |
72 schedulePub(args: ['global', 'list'], output: '\n'); | |
73 }); | |
74 } | |
OLD | NEW |