OLD | NEW |
(Empty) | |
| 1 library pub_tests; |
| 2 import 'dart:convert'; |
| 3 import 'descriptor.dart' as d; |
| 4 import 'test_pub.dart'; |
| 5 main() { |
| 6 initConfig(); |
| 7 forBothPubGetAndUpgrade((command) { |
| 8 integration('fails gracefully on a dependency from an unknown source', () { |
| 9 d.appDir({ |
| 10 "foo": { |
| 11 "bad": "foo" |
| 12 } |
| 13 }).create(); |
| 14 pubCommand( |
| 15 command, |
| 16 error: 'Package myapp depends on foo from unknown source "bad".'); |
| 17 }); |
| 18 integration( |
| 19 'fails gracefully on transitive dependency from an unknown ' 'source', |
| 20 () { |
| 21 d.dir( |
| 22 'foo', |
| 23 [d.libDir('foo', 'foo 0.0.1'), d.libPubspec('foo', '0.0.1', deps: { |
| 24 "bar": { |
| 25 "bad": "bar" |
| 26 } |
| 27 })]).create(); |
| 28 d.appDir({ |
| 29 "foo": { |
| 30 "path": "../foo" |
| 31 } |
| 32 }).create(); |
| 33 pubCommand( |
| 34 command, |
| 35 error: 'Package foo depends on bar from unknown source "bad".'); |
| 36 }); |
| 37 integration('ignores unknown source in lockfile', () { |
| 38 d.dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create(); |
| 39 d.dir(appPath, [d.appPubspec({ |
| 40 "foo": { |
| 41 "path": "../foo" |
| 42 } |
| 43 })]).create(); |
| 44 d.dir(appPath, [d.file("pubspec.lock", JSON.encode({ |
| 45 'packages': { |
| 46 'foo': { |
| 47 'version': '0.0.0', |
| 48 'source': 'bad', |
| 49 'description': { |
| 50 'name': 'foo' |
| 51 } |
| 52 } |
| 53 } |
| 54 }))]).create(); |
| 55 pubCommand(command); |
| 56 d.dir( |
| 57 packagesPath, |
| 58 [d.dir("foo", [d.file("foo.dart", 'main() => "foo";')])]).validate(); |
| 59 }); |
| 60 }); |
| 61 } |
OLD | NEW |