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 pubGet(args: ["--packages-dir"]); |
22 | 22 |
23 d.dir(cachePath, [ | 23 d.dir(cachePath, [ |
24 d.dir('git', [ | 24 d.dir('git', [ |
25 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), | 25 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), |
26 d.gitPackageRevisionCacheDir('foo') | 26 d.gitPackageRevisionCacheDir('foo') |
27 ]) | 27 ]) |
28 ]).validate(); | 28 ]).validate(); |
29 | 29 |
30 d.dir(packagesPath, [ | 30 d.dir(packagesPath, [ |
31 d.dir('foo', [ | 31 d.dir('foo', [ |
32 d.file('foo.dart', 'main() => "foo";') | 32 d.file('foo.dart', 'main() => "foo";') |
33 ]) | 33 ]) |
34 ]).validate(); | 34 ]).validate(); |
35 | 35 |
36 d.git('foo.git', [ | 36 d.git('foo.git', [ |
37 d.libDir('foo', 'foo 2'), | 37 d.libDir('foo', 'foo 2'), |
38 d.libPubspec('foo', '1.0.0') | 38 d.libPubspec('foo', '1.0.0') |
39 ]).commit(); | 39 ]).commit(); |
40 | 40 |
41 pubUpgrade(output: contains("Changed 1 dependency!")); | 41 pubUpgrade( |
| 42 args: ["--packages-dir"], |
| 43 output: contains("Changed 1 dependency!")); |
42 | 44 |
43 // When we download a new version of the git package, we should re-use the | 45 // 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. | 46 // git/cache directory but create a new git/ directory. |
45 d.dir(cachePath, [ | 47 d.dir(cachePath, [ |
46 d.dir('git', [ | 48 d.dir('git', [ |
47 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), | 49 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), |
48 d.gitPackageRevisionCacheDir('foo'), | 50 d.gitPackageRevisionCacheDir('foo'), |
49 d.gitPackageRevisionCacheDir('foo', 2) | 51 d.gitPackageRevisionCacheDir('foo', 2) |
50 ]) | 52 ]) |
51 ]).validate(); | 53 ]).validate(); |
52 | 54 |
53 d.dir(packagesPath, [ | 55 d.dir(packagesPath, [ |
54 d.dir('foo', [ | 56 d.dir('foo', [ |
55 d.file('foo.dart', 'main() => "foo 2";') | 57 d.file('foo.dart', 'main() => "foo 2";') |
56 ]) | 58 ]) |
57 ]).validate(); | 59 ]).validate(); |
58 }); | 60 }); |
59 } | 61 } |
OLD | NEW |