OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.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 d.file. | 3 // BSD-style license that can be found in the LICENSE d.file. |
4 | 4 |
5 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
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 initConfig(); | 13 initConfig(); |
14 | 14 |
15 forBothPubGetAndUpgrade((command) { | 15 forBothPubGetAndUpgrade((command) { |
16 integration('fails gracefully on a dependency from an unknown source', () { | 16 integration('fails gracefully on a dependency from an unknown source', () { |
17 d.appDir({"foo": {"bad": "foo"}}).create(); | 17 d.appDir({"foo": {"bad": "foo"}}).create(); |
18 | 18 |
19 pubCommand(command, error: | 19 pubCommand(command, error: |
20 "Package 'myapp' depends on 'foo' from unknown source 'bad'."); | 20 'Package myapp depends on foo from unknown source "bad".'); |
21 }); | 21 }); |
22 | 22 |
23 integration('fails gracefully on transitive dependency from an unknown ' | 23 integration('fails gracefully on transitive dependency from an unknown ' |
24 'source', () { | 24 'source', () { |
25 d.dir('foo', [ | 25 d.dir('foo', [ |
26 d.libDir('foo', 'foo 0.0.1'), | 26 d.libDir('foo', 'foo 0.0.1'), |
27 d.libPubspec('foo', '0.0.1', deps: {"bar": {"bad": "bar"}}) | 27 d.libPubspec('foo', '0.0.1', deps: {"bar": {"bad": "bar"}}) |
28 ]).create(); | 28 ]).create(); |
29 | 29 |
30 d.appDir({"foo": {"path": "../foo"}}).create(); | 30 d.appDir({"foo": {"path": "../foo"}}).create(); |
31 | 31 |
32 pubCommand(command, error: | 32 pubCommand(command, error: |
33 "Package 'foo' depends on 'bar' from unknown source 'bad'."); | 33 'Package foo depends on bar from unknown source "bad".'); |
34 }); | 34 }); |
35 | 35 |
36 integration('ignores unknown source in lockfile', () { | 36 integration('ignores unknown source in lockfile', () { |
37 d.dir('foo', [ | 37 d.dir('foo', [ |
38 d.libDir('foo'), | 38 d.libDir('foo'), |
39 d.libPubspec('foo', '0.0.1') | 39 d.libPubspec('foo', '0.0.1') |
40 ]).create(); | 40 ]).create(); |
41 | 41 |
42 // Depend on "foo" from a valid source. | 42 // Depend on "foo" from a valid source. |
43 d.dir(appPath, [ | 43 d.dir(appPath, [ |
(...skipping 21 matching lines...) Expand all Loading... |
65 | 65 |
66 // Should upgrade to the new one. | 66 // Should upgrade to the new one. |
67 d.dir(packagesPath, [ | 67 d.dir(packagesPath, [ |
68 d.dir("foo", [ | 68 d.dir("foo", [ |
69 d.file("foo.dart", 'main() => "foo";') | 69 d.file("foo.dart", 'main() => "foo";') |
70 ]) | 70 ]) |
71 ]).validate(); | 71 ]).validate(); |
72 }); | 72 }); |
73 }); | 73 }); |
74 } | 74 } |
OLD | NEW |