| 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 '../../descriptor.dart' as d; | 5 import '../../descriptor.dart' as d; |
| 6 import '../../test_pub.dart'; | 6 import '../../test_pub.dart'; |
| 7 | 7 |
| 8 main() { | 8 main() { |
| 9 integration("upgrades Git packages to a nonexistent pubspec", () { | 9 integration("upgrades Git packages to a nonexistent pubspec", () { |
| 10 ensureGit(); | 10 ensureGit(); |
| 11 | 11 |
| 12 var repo = d.git('foo.git', [ | 12 var repo = d.git('foo.git', [ |
| 13 d.libDir('foo'), | 13 d.libDir('foo'), |
| 14 d.libPubspec('foo', '1.0.0') | 14 d.libPubspec('foo', '1.0.0') |
| 15 ]); | 15 ]); |
| 16 repo.create(); | 16 repo.create(); |
| 17 | 17 |
| 18 d.appDir({"foo": {"git": "../foo.git"}}).create(); | 18 d.appDir({"foo": {"git": "../foo.git"}}).create(); |
| 19 | 19 |
| 20 pubGet(); | 20 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 21 // ".packages" file instead of looking in the "packages" directory. |
| 22 pubGet(args: ["--packages-dir"]); |
| 21 | 23 |
| 22 d.dir(packagesPath, [ | 24 d.dir(packagesPath, [ |
| 23 d.dir('foo', [ | 25 d.dir('foo', [ |
| 24 d.file('foo.dart', 'main() => "foo";') | 26 d.file('foo.dart', 'main() => "foo";') |
| 25 ]) | 27 ]) |
| 26 ]).validate(); | 28 ]).validate(); |
| 27 | 29 |
| 28 repo.runGit(['rm', 'pubspec.yaml']); | 30 repo.runGit(['rm', 'pubspec.yaml']); |
| 29 repo.runGit(['commit', '-m', 'delete']); | 31 repo.runGit(['commit', '-m', 'delete']); |
| 30 | 32 |
| 31 pubUpgrade(error: new RegExp(r'Could not find a file named "pubspec.yaml" ' | 33 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 32 r'in [^\n]*\.')); | 34 // ".packages" file instead of looking in the "packages" directory. |
| 35 pubUpgrade( |
| 36 args: ["--packages-dir"], |
| 37 error: new RegExp(r'Could not find a file named "pubspec.yaml" ' |
| 38 r'in [^\n]*\.')); |
| 33 | 39 |
| 34 d.dir(packagesPath, [ | 40 d.dir(packagesPath, [ |
| 35 d.dir('foo', [ | 41 d.dir('foo', [ |
| 36 d.file('foo.dart', 'main() => "foo";') | 42 d.file('foo.dart', 'main() => "foo";') |
| 37 ]) | 43 ]) |
| 38 ]).validate(); | 44 ]).validate(); |
| 39 }); | 45 }); |
| 40 } | 46 } |
| OLD | NEW |