OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
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 integration('checks out and upgrades a package from Git', () { | 11 integration('checks out and upgrades a package from Git', () { |
12 ensureGit(); | 12 ensureGit(); |
13 | 13 |
14 d.git('foo.git', [ | 14 d.git('foo.git', [ |
15 d.libDir('foo'), | 15 d.libDir('foo'), |
16 d.libPubspec('foo', '1.0.0') | 16 d.libPubspec('foo', '1.0.0') |
17 ]).create(); | 17 ]).create(); |
18 | 18 |
19 d.appDir({"foo": {"git": "../foo.git"}}).create(); | 19 d.appDir({"foo": {"git": "../foo.git"}}).create(); |
20 | 20 |
21 pubGet(); | 21 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 22 // ".packages" file instead of looking in the "packages" directory. |
| 23 pubGet(args: ["--packages-dir"]); |
22 | 24 |
23 d.dir(cachePath, [ | 25 d.dir(cachePath, [ |
24 d.dir('git', [ | 26 d.dir('git', [ |
25 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), | 27 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), |
26 d.gitPackageRevisionCacheDir('foo') | 28 d.gitPackageRevisionCacheDir('foo') |
27 ]) | 29 ]) |
28 ]).validate(); | 30 ]).validate(); |
29 | 31 |
30 d.dir(packagesPath, [ | 32 d.dir(packagesPath, [ |
31 d.dir('foo', [ | 33 d.dir('foo', [ |
32 d.file('foo.dart', 'main() => "foo";') | 34 d.file('foo.dart', 'main() => "foo";') |
33 ]) | 35 ]) |
34 ]).validate(); | 36 ]).validate(); |
35 | 37 |
36 d.git('foo.git', [ | 38 d.git('foo.git', [ |
37 d.libDir('foo', 'foo 2'), | 39 d.libDir('foo', 'foo 2'), |
38 d.libPubspec('foo', '1.0.0') | 40 d.libPubspec('foo', '1.0.0') |
39 ]).commit(); | 41 ]).commit(); |
40 | 42 |
41 pubUpgrade(output: contains("Changed 1 dependency!")); | 43 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 44 // ".packages" file instead of looking in the "packages" directory. |
| 45 pubUpgrade( |
| 46 args: ["--packages-dir"], |
| 47 output: contains("Changed 1 dependency!")); |
42 | 48 |
43 // When we download a new version of the git package, we should re-use the | 49 // When we download a new version of the git package, we should re-use the |
44 // git/cache directory but create a new git/ directory. | 50 // git/cache directory but create a new git/ directory. |
45 d.dir(cachePath, [ | 51 d.dir(cachePath, [ |
46 d.dir('git', [ | 52 d.dir('git', [ |
47 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), | 53 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), |
48 d.gitPackageRevisionCacheDir('foo'), | 54 d.gitPackageRevisionCacheDir('foo'), |
49 d.gitPackageRevisionCacheDir('foo', 2) | 55 d.gitPackageRevisionCacheDir('foo', 2) |
50 ]) | 56 ]) |
51 ]).validate(); | 57 ]).validate(); |
52 | 58 |
53 d.dir(packagesPath, [ | 59 d.dir(packagesPath, [ |
54 d.dir('foo', [ | 60 d.dir('foo', [ |
55 d.file('foo.dart', 'main() => "foo 2";') | 61 d.file('foo.dart', 'main() => "foo 2";') |
56 ]) | 62 ]) |
57 ]).validate(); | 63 ]).validate(); |
58 }); | 64 }); |
59 } | 65 } |
OLD | NEW |