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:path/path.dart' as path; | 5 import 'package:path/path.dart' as path; |
6 import 'package:pub/src/io.dart'; | 6 import 'package:pub/src/io.dart'; |
7 import 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
8 | 8 |
9 import '../../descriptor.dart' as d; | 9 import '../../descriptor.dart' as d; |
10 import '../../test_pub.dart'; | 10 import '../../test_pub.dart'; |
11 | 11 |
12 // Regression test for issue 16470. | 12 // Regression test for issue 16470. |
13 | 13 |
14 main() { | 14 main() { |
15 integration('checks out the repository for a locked revision', () { | 15 integration('checks out the repository for a locked revision', () { |
16 ensureGit(); | 16 ensureGit(); |
17 | 17 |
18 d.git('foo.git', [ | 18 d.git('foo.git', [ |
19 d.libDir('foo'), | 19 d.libDir('foo'), |
20 d.libPubspec('foo', '1.0.0') | 20 d.libPubspec('foo', '1.0.0') |
21 ]).create(); | 21 ]).create(); |
22 | 22 |
23 d.appDir({"foo": {"git": "../foo.git"}}).create(); | 23 d.appDir({"foo": {"git": "../foo.git"}}).create(); |
24 | 24 |
25 // This get should lock the foo.git dependency to the current revision. | 25 // This get should lock the foo.git dependency to the current revision. |
26 pubGet(); | 26 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 27 // ".packages" file instead of looking in the "packages" directory. |
| 28 pubGet(args: ["--packages-dir"]); |
27 | 29 |
28 d.dir(packagesPath, [ | 30 d.dir(packagesPath, [ |
29 d.dir('foo', [ | 31 d.dir('foo', [ |
30 d.file('foo.dart', 'main() => "foo";') | 32 d.file('foo.dart', 'main() => "foo";') |
31 ]) | 33 ]) |
32 ]).validate(); | 34 ]).validate(); |
33 | 35 |
34 // Delete the packages path and the cache to simulate a brand new checkout | 36 // Delete the packages path and the cache to simulate a brand new checkout |
35 // of the application. | 37 // of the application. |
36 schedule(() => deleteEntry(path.join(sandboxDir, packagesPath))); | 38 schedule(() => deleteEntry(path.join(sandboxDir, packagesPath))); |
37 schedule(() => deleteEntry(path.join(sandboxDir, cachePath))); | 39 schedule(() => deleteEntry(path.join(sandboxDir, cachePath))); |
38 | 40 |
39 d.git('foo.git', [ | 41 d.git('foo.git', [ |
40 d.libDir('foo', 'foo 2'), | 42 d.libDir('foo', 'foo 2'), |
41 d.libPubspec('foo', '1.0.0') | 43 d.libPubspec('foo', '1.0.0') |
42 ]).commit(); | 44 ]).commit(); |
43 | 45 |
44 // This get shouldn't upgrade the foo.git dependency due to the lockfile. | 46 // This get shouldn't upgrade the foo.git dependency due to the lockfile. |
45 pubGet(); | 47 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 48 // ".packages" file instead of looking in the "packages" directory. |
| 49 pubGet(args: ["--packages-dir"]); |
46 | 50 |
47 d.dir(packagesPath, [ | 51 d.dir(packagesPath, [ |
48 d.dir('foo', [ | 52 d.dir('foo', [ |
49 d.file('foo.dart', 'main() => "foo";') | 53 d.file('foo.dart', 'main() => "foo";') |
50 ]) | 54 ]) |
51 ]).validate(); | 55 ]).validate(); |
52 }); | 56 }); |
53 } | 57 } |
OLD | NEW |