| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 p; | 5 import 'package:path/path.dart' as p; |
| 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("doesn't re-fetch a repository if nothing changes", () { | 13 integration("doesn't re-fetch a repository if nothing changes", () { |
| 14 ensureGit(); | 14 ensureGit(); |
| 15 | 15 |
| 16 var repo = d.git('foo.git', [ | 16 var repo = 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 ]); | 19 ]); |
| 20 repo.create(); | 20 repo.create(); |
| 21 | 21 |
| 22 d.appDir({ | 22 d.appDir({ |
| 23 "foo": {"git": {"url": "../foo.git"}} | 23 "foo": {"git": {"url": "../foo.git"}} |
| 24 }).create(); | 24 }).create(); |
| 25 | 25 |
| 26 pubGet(); | 26 pubGet(args: ["--packages-dir"]); |
| 27 | 27 |
| 28 d.dir(packagesPath, [ | 28 d.dir(packagesPath, [ |
| 29 d.dir('foo', [ | 29 d.dir('foo', [ |
| 30 d.file('foo.dart', 'main() => "foo";') | 30 d.file('foo.dart', 'main() => "foo";') |
| 31 ]) | 31 ]) |
| 32 ]).validate(); | 32 ]).validate(); |
| 33 | 33 |
| 34 // Delete the repo. This will cause "pub get" to fail if it tries to | 34 // Delete the repo. This will cause "pub get" to fail if it tries to |
| 35 // re-fetch. | 35 // re-fetch. |
| 36 schedule(() => deleteEntry(p.join(sandboxDir, 'foo.git'))); | 36 schedule(() => deleteEntry(p.join(sandboxDir, 'foo.git'))); |
| 37 | 37 |
| 38 pubGet(); | 38 pubGet(args: ["--packages-dir"]); |
| 39 | 39 |
| 40 d.dir(packagesPath, [ | 40 d.dir(packagesPath, [ |
| 41 d.dir('foo', [ | 41 d.dir('foo', [ |
| 42 d.file('foo.dart', 'main() => "foo";') | 42 d.file('foo.dart', 'main() => "foo";') |
| 43 ]) | 43 ]) |
| 44 ]).validate(); | 44 ]).validate(); |
| 45 }); | 45 }); |
| 46 } | 46 } |
| OLD | NEW |