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:pub/src/exit_codes.dart' as exit_codes; | 5 import 'package:pub/src/exit_codes.dart' as exit_codes; |
6 import 'package:scheduled_test/scheduled_test.dart'; | 6 import 'package:scheduled_test/scheduled_test.dart'; |
7 | 7 |
8 import '../../descriptor.dart' as d; | 8 import '../../descriptor.dart' as d; |
9 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 integration("upgrades Git packages to an incompatible pubspec", () { | 12 integration("upgrades Git packages to an incompatible pubspec", () { |
13 ensureGit(); | 13 ensureGit(); |
14 | 14 |
15 d.git('foo.git', [ | 15 d.git('foo.git', [ |
16 d.libDir('foo'), | 16 d.libDir('foo'), |
17 d.libPubspec('foo', '1.0.0') | 17 d.libPubspec('foo', '1.0.0') |
18 ]).create(); | 18 ]).create(); |
19 | 19 |
20 d.appDir({"foo": {"git": "../foo.git"}}).create(); | 20 d.appDir({"foo": {"git": "../foo.git"}}).create(); |
21 | 21 |
22 pubGet(); | 22 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
| 23 // ".packages" file instead of looking in the "packages" directory. |
| 24 pubGet(args: ["--packages-dir"]); |
23 | 25 |
24 d.dir(packagesPath, [ | 26 d.dir(packagesPath, [ |
25 d.dir('foo', [ | 27 d.dir('foo', [ |
26 d.file('foo.dart', 'main() => "foo";') | 28 d.file('foo.dart', 'main() => "foo";') |
27 ]) | 29 ]) |
28 ]).validate(); | 30 ]).validate(); |
29 | 31 |
30 d.git('foo.git', [ | 32 d.git('foo.git', [ |
31 d.libDir('zoo'), | 33 d.libDir('zoo'), |
32 d.libPubspec('zoo', '1.0.0') | 34 d.libPubspec('zoo', '1.0.0') |
33 ]).commit(); | 35 ]).commit(); |
34 | 36 |
35 pubUpgrade(error: contains('"name" field doesn\'t match expected name ' | 37 // TODO(rnystrom): Remove "--packages-dir" and validate using the |
36 '"foo".'), exitCode: exit_codes.DATA); | 38 // ".packages" file instead of looking in the "packages" directory. |
| 39 pubUpgrade( |
| 40 args: ['--packages-dir'], |
| 41 error: contains('"name" field doesn\'t match expected name "foo".'), |
| 42 exitCode: exit_codes.DATA); |
37 | 43 |
38 d.dir(packagesPath, [ | 44 d.dir(packagesPath, [ |
39 d.dir('foo', [ | 45 d.dir('foo', [ |
40 d.file('foo.dart', 'main() => "foo";') | 46 d.file('foo.dart', 'main() => "foo";') |
41 ]) | 47 ]) |
42 ]).validate(); | 48 ]).validate(); |
43 }); | 49 }); |
44 } | 50 } |
OLD | NEW |