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 main() { | 12 main() { |
13 integration('keeps a Git package locked to the version in the lockfile', () { | 13 integration('keeps a Git package locked to the version in the lockfile', () { |
14 ensureGit(); | 14 ensureGit(); |
15 | 15 |
16 d.git('foo.git', [ | 16 d.git('foo.git', [ |
17 d.libDir('foo'), | 17 d.libDir('foo'), |
18 d.libPubspec('foo', '1.0.0') | 18 d.libPubspec('foo', '1.0.0') |
19 ]).create(); | 19 ]).create(); |
20 | 20 |
21 d.appDir({"foo": {"git": "../foo.git"}}).create(); | 21 d.appDir({"foo": {"git": "../foo.git"}}).create(); |
22 | 22 |
23 // This get should lock the foo.git dependency to the current revision. | 23 // This get should lock the foo.git dependency to the current revision. |
24 pubGet(); | 24 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 25 // ".packages" file instead of looking in the "packages" directory. |
| 26 pubGet(args: ["--packages-dir"]); |
25 | 27 |
26 d.dir(packagesPath, [ | 28 d.dir(packagesPath, [ |
27 d.dir('foo', [ | 29 d.dir('foo', [ |
28 d.file('foo.dart', 'main() => "foo";') | 30 d.file('foo.dart', 'main() => "foo";') |
29 ]) | 31 ]) |
30 ]).validate(); | 32 ]).validate(); |
31 | 33 |
32 // Delete the packages path to simulate a new checkout of the application. | 34 // Delete the packages path to simulate a new checkout of the application. |
33 schedule(() => deleteEntry(path.join(sandboxDir, packagesPath))); | 35 schedule(() => deleteEntry(path.join(sandboxDir, packagesPath))); |
34 | 36 |
35 d.git('foo.git', [ | 37 d.git('foo.git', [ |
36 d.libDir('foo', 'foo 2'), | 38 d.libDir('foo', 'foo 2'), |
37 d.libPubspec('foo', '1.0.0') | 39 d.libPubspec('foo', '1.0.0') |
38 ]).commit(); | 40 ]).commit(); |
39 | 41 |
40 // This get shouldn't upgrade the foo.git dependency due to the lockfile. | 42 // This get shouldn't upgrade the foo.git dependency due to the lockfile. |
41 pubGet(); | 43 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 44 // ".packages" file instead of looking in the "packages" directory. |
| 45 pubGet(args: ["--packages-dir"]); |
42 | 46 |
43 d.dir(packagesPath, [ | 47 d.dir(packagesPath, [ |
44 d.dir('foo', [ | 48 d.dir('foo', [ |
45 d.file('foo.dart', 'main() => "foo";') | 49 d.file('foo.dart', 'main() => "foo";') |
46 ]) | 50 ]) |
47 ]).validate(); | 51 ]).validate(); |
48 }); | 52 }); |
49 } | 53 } |
OLD | NEW |