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