| 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 pubGet(args: ["--packages-dir"]); |
| 25 | 25 |
| 26 d.dir(packagesPath, [ | 26 d.dir(packagesPath, [ |
| 27 d.dir('foo', [ | 27 d.dir('foo', [ |
| 28 d.file('foo.dart', 'main() => "foo";') | 28 d.file('foo.dart', 'main() => "foo";') |
| 29 ]) | 29 ]) |
| 30 ]).validate(); | 30 ]).validate(); |
| 31 | 31 |
| 32 // Delete the packages path to simulate a new checkout of the application. | 32 // Delete the packages path to simulate a new checkout of the application. |
| 33 schedule(() => deleteEntry(path.join(sandboxDir, packagesPath))); | 33 schedule(() => deleteEntry(path.join(sandboxDir, packagesPath))); |
| 34 | 34 |
| 35 d.git('foo.git', [ | 35 d.git('foo.git', [ |
| 36 d.libDir('foo', 'foo 2'), | 36 d.libDir('foo', 'foo 2'), |
| 37 d.libPubspec('foo', '1.0.0') | 37 d.libPubspec('foo', '1.0.0') |
| 38 ]).commit(); | 38 ]).commit(); |
| 39 | 39 |
| 40 // This get shouldn't upgrade the foo.git dependency due to the lockfile. | 40 // This get shouldn't upgrade the foo.git dependency due to the lockfile. |
| 41 pubGet(); | 41 pubGet(args: ["--packages-dir"]); |
| 42 | 42 |
| 43 d.dir(packagesPath, [ | 43 d.dir(packagesPath, [ |
| 44 d.dir('foo', [ | 44 d.dir('foo', [ |
| 45 d.file('foo.dart', 'main() => "foo";') | 45 d.file('foo.dart', 'main() => "foo";') |
| 46 ]) | 46 ]) |
| 47 ]).validate(); | 47 ]).validate(); |
| 48 }); | 48 }); |
| 49 } | 49 } |
| OLD | NEW |