OLD | NEW |
(Empty) | |
| 1 import 'package:scheduled_test/scheduled_test.dart'; |
| 2 import '../../descriptor.dart' as d; |
| 3 import '../../test_pub.dart'; |
| 4 main() { |
| 5 initConfig(); |
| 6 integration('uses the 1.6-style lockfile if necessary', () { |
| 7 servePackages((builder) { |
| 8 builder.serve("bar", "1.0.0"); |
| 9 builder.serve("foo", "1.0.0", deps: { |
| 10 "bar": "any" |
| 11 }, contents: [d.dir("bin", [d.file("script.dart", """ |
| 12 import 'package:bar/bar.dart' as bar; |
| 13 |
| 14 main(args) => print(bar.main());""")])]); |
| 15 }); |
| 16 schedulePub(args: ["cache", "add", "foo"]); |
| 17 schedulePub(args: ["cache", "add", "bar"]); |
| 18 d.dir(cachePath, [d.dir('global_packages', [d.file('foo.lock', ''' |
| 19 packages: |
| 20 foo: |
| 21 description: foo |
| 22 source: hosted |
| 23 version: "1.0.0" |
| 24 bar: |
| 25 description: bar |
| 26 source: hosted |
| 27 version: "1.0.0"''')])]).create(); |
| 28 var pub = pubRun(global: true, args: ["foo:script"]); |
| 29 pub.stdout.expect("bar 1.0.0"); |
| 30 pub.shouldExit(); |
| 31 d.dir( |
| 32 cachePath, |
| 33 [ |
| 34 d.dir( |
| 35 'global_packages', |
| 36 [ |
| 37 d.nothing('foo.lock'), |
| 38 d.dir('foo', [d.matcherFile('pubspec.lock', contains('1.0.0'
))])])]).validate(); |
| 39 }); |
| 40 } |
OLD | NEW |