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