| 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 library pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import '../../../../../pkg/pathos/lib/path.dart' as path; | |
| 10 import '../../../../../pkg/scheduled_test/lib/scheduled_test.dart'; | |
| 11 | |
| 12 import '../../../../pub/io.dart'; | |
| 13 import '../../descriptor.dart' as d; | |
| 14 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
| 15 | 10 |
| 16 main() { | 11 main() { |
| 17 integration('keeps a Git package locked to the version in the lockfile', () { | 12 integration('keeps a Git package locked to the version in the lockfile', () { |
| 18 ensureGit(); | 13 ensureGit(); |
| 19 | 14 |
| 20 d.git('foo.git', [ | 15 git('foo.git', [ |
| 21 d.libDir('foo'), | 16 libDir('foo'), |
| 22 d.libPubspec('foo', '1.0.0') | 17 libPubspec('foo', '1.0.0') |
| 23 ]).create(); | 18 ]).scheduleCreate(); |
| 24 | 19 |
| 25 d.appDir([{"git": "../foo.git"}]).create(); | 20 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
| 26 | 21 |
| 27 // This install should lock the foo.git dependency to the current revision. | 22 // This install should lock the foo.git dependency to the current revision. |
| 28 schedulePub(args: ['install'], | 23 schedulePub(args: ['install'], |
| 29 output: new RegExp(r"Dependencies installed!$")); | 24 output: new RegExp(r"Dependencies installed!$")); |
| 30 | 25 |
| 31 d.dir(packagesPath, [ | 26 dir(packagesPath, [ |
| 32 d.dir('foo', [ | 27 dir('foo', [ |
| 33 d.file('foo.dart', 'main() => "foo";') | 28 file('foo.dart', 'main() => "foo";') |
| 34 ]) | 29 ]) |
| 35 ]).validate(); | 30 ]).scheduleValidate(); |
| 36 | 31 |
| 37 // 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. |
| 38 schedule(() => deleteDir(path.join(sandboxDir, packagesPath))); | 33 dir(packagesPath).scheduleDelete(); |
| 39 | 34 |
| 40 d.git('foo.git', [ | 35 git('foo.git', [ |
| 41 d.libDir('foo', 'foo 2'), | 36 libDir('foo', 'foo 2'), |
| 42 d.libPubspec('foo', '1.0.0') | 37 libPubspec('foo', '1.0.0') |
| 43 ]).commit(); | 38 ]).scheduleCommit(); |
| 44 | 39 |
| 45 // This install shouldn't update the foo.git dependency due to the lockfile. | 40 // This install shouldn't update the foo.git dependency due to the lockfile. |
| 46 schedulePub(args: ['install'], | 41 schedulePub(args: ['install'], |
| 47 output: new RegExp(r"Dependencies installed!$")); | 42 output: new RegExp(r"Dependencies installed!$")); |
| 48 | 43 |
| 49 d.dir(packagesPath, [ | 44 dir(packagesPath, [ |
| 50 d.dir('foo', [ | 45 dir('foo', [ |
| 51 d.file('foo.dart', 'main() => "foo";') | 46 file('foo.dart', 'main() => "foo";') |
| 52 ]) | 47 ]) |
| 53 ]).validate(); | 48 ]).scheduleValidate(); |
| 54 }); | 49 }); |
| 55 } | 50 } |
| OLD | NEW |