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 library pub_tests; | |
6 | |
7 import '../../descriptor.dart' as d; | |
8 import '../../test_pub.dart'; | |
9 | |
10 main() { | |
11 initConfig(); | |
12 integration('"--all" adds all non-installed versions of the package', () { | |
13 servePackages((builder) { | |
14 builder.serve("foo", "1.2.1"); | |
15 builder.serve("foo", "1.2.2"); | |
16 builder.serve("foo", "1.2.3"); | |
17 builder.serve("foo", "2.0.0"); | |
18 }); | |
19 | |
20 // Install a couple of versions first. | |
21 schedulePub( | |
22 args: ["cache", "add", "foo", "-v", "1.2.1"], | |
23 output: 'Downloading foo 1.2.1...'); | |
24 | |
25 schedulePub( | |
26 args: ["cache", "add", "foo", "-v", "1.2.3"], | |
27 output: 'Downloading foo 1.2.3...'); | |
28 | |
29 // They should show up as already installed now. | |
30 schedulePub(args: ["cache", "add", "foo", "--all"], output: ''' | |
31 Already cached foo 1.2.1. | |
32 Downloading foo 1.2.2... | |
33 Already cached foo 1.2.3. | |
34 Downloading foo 2.0.0...'''); | |
35 | |
36 d.cacheDir({ | |
37 "foo": "1.2.1" | |
38 }).validate(); | |
39 d.cacheDir({ | |
40 "foo": "1.2.2" | |
41 }).validate(); | |
42 d.cacheDir({ | |
43 "foo": "1.2.3" | |
44 }).validate(); | |
45 d.cacheDir({ | |
46 "foo": "2.0.0" | |
47 }).validate(); | |
48 }); | |
49 } | |
OLD | NEW |