OLD | NEW |
(Empty) | |
| 1 library pub_cache_test; |
| 2 import 'package:path/path.dart' as path; |
| 3 import '../descriptor.dart' as d; |
| 4 import '../test_pub.dart'; |
| 5 main() { |
| 6 initConfig(); |
| 7 hostedDir(package) { |
| 8 return path.join( |
| 9 sandboxDir, |
| 10 cachePath, |
| 11 "hosted", |
| 12 "pub.dartlang.org", |
| 13 package); |
| 14 } |
| 15 integration('running pub cache list when there is no cache', () { |
| 16 schedulePub(args: ['cache', 'list'], output: '{"packages":{}}'); |
| 17 }); |
| 18 integration('running pub cache list on empty cache', () { |
| 19 d.dir( |
| 20 cachePath, |
| 21 [d.dir('hosted', [d.dir('pub.dartlang.org', [])])]).create(); |
| 22 schedulePub(args: ['cache', 'list'], outputJson: { |
| 23 "packages": {} |
| 24 }); |
| 25 }); |
| 26 integration('running pub cache list', () { |
| 27 d.dir( |
| 28 cachePath, |
| 29 [ |
| 30 d.dir( |
| 31 'hosted', |
| 32 [ |
| 33 d.dir( |
| 34 'pub.dartlang.org', |
| 35 [ |
| 36 d.dir("foo-1.2.3", [d.libPubspec("foo", "1.2.3"), d.
libDir("foo")]), |
| 37 d.dir( |
| 38 "bar-2.0.0", |
| 39 [d.libPubspec("bar", "2.0.0"), d.libDir("bar")])
])])]).create(); |
| 40 schedulePub(args: ['cache', 'list'], outputJson: { |
| 41 "packages": { |
| 42 "bar": { |
| 43 "2.0.0": { |
| 44 "location": hostedDir('bar-2.0.0') |
| 45 } |
| 46 }, |
| 47 "foo": { |
| 48 "1.2.3": { |
| 49 "location": hostedDir('foo-1.2.3') |
| 50 } |
| 51 } |
| 52 } |
| 53 }); |
| 54 }); |
| 55 integration('includes packages containing deps with bad sources', () { |
| 56 d.dir( |
| 57 cachePath, |
| 58 [ |
| 59 d.dir( |
| 60 'hosted', |
| 61 [ |
| 62 d.dir( |
| 63 'pub.dartlang.org', |
| 64 [d.dir("foo-1.2.3", [d.libPubspec("foo", "1.2.3", deps:
{ |
| 65 "bar": { |
| 66 "bad": "bar" |
| 67 } |
| 68 }), d.libDir("foo")])])])]).create(); |
| 69 schedulePub(args: ['cache', 'list'], outputJson: { |
| 70 "packages": { |
| 71 "foo": { |
| 72 "1.2.3": { |
| 73 "location": hostedDir('foo-1.2.3') |
| 74 } |
| 75 } |
| 76 } |
| 77 }); |
| 78 }); |
| 79 } |
OLD | NEW |