OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
6 | 6 |
7 import '../../descriptor.dart' as d; | 7 import '../../descriptor.dart' as d; |
8 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 initConfig(); | 11 initConfig(); |
12 integration('uses the 1.6-style lockfile if necessary', () { | 12 integration('uses the 1.6-style lockfile if necessary', () { |
13 servePackages((builder) { | 13 servePackages((builder) { |
14 builder.serve("bar", "1.0.0"); | 14 builder.serve("bar", "1.0.0"); |
15 builder.serve("foo", "1.0.0", deps: {"bar": "any"}, contents: [ | 15 builder.serve("foo", "1.0.0", deps: { |
16 d.dir("bin", [ | 16 "bar": "any" |
17 d.file("script.dart", """ | 17 }, contents: [d.dir("bin", [d.file("script.dart", """ |
18 import 'package:bar/bar.dart' as bar; | 18 import 'package:bar/bar.dart' as bar; |
19 | 19 |
20 main(args) => print(bar.main());""") | 20 main(args) => print(bar.main());""")])]); |
21 ]) | |
22 ]); | |
23 }); | 21 }); |
24 | 22 |
25 schedulePub(args: ["cache", "add", "foo"]); | 23 schedulePub(args: ["cache", "add", "foo"]); |
26 schedulePub(args: ["cache", "add", "bar"]); | 24 schedulePub(args: ["cache", "add", "bar"]); |
27 | 25 |
28 d.dir(cachePath, [ | 26 d.dir(cachePath, [d.dir('global_packages', [d.file('foo.lock', ''' |
29 d.dir('global_packages', [ | |
30 d.file('foo.lock', ''' | |
31 packages: | 27 packages: |
32 foo: | 28 foo: |
33 description: foo | 29 description: foo |
34 source: hosted | 30 source: hosted |
35 version: "1.0.0" | 31 version: "1.0.0" |
36 bar: | 32 bar: |
37 description: bar | 33 description: bar |
38 source: hosted | 34 source: hosted |
39 version: "1.0.0"''') | 35 version: "1.0.0"''')])]).create(); |
40 ]) | |
41 ]).create(); | |
42 | 36 |
43 var pub = pubRun(global: true, args: ["foo:script"]); | 37 var pub = pubRun(global: true, args: ["foo:script"]); |
44 pub.stdout.expect("bar 1.0.0"); | 38 pub.stdout.expect("bar 1.0.0"); |
45 pub.shouldExit(); | 39 pub.shouldExit(); |
46 | 40 |
47 d.dir(cachePath, [ | 41 d.dir( |
48 d.dir('global_packages', [ | 42 cachePath, |
49 d.nothing('foo.lock'), | 43 [ |
50 d.dir('foo', [d.matcherFile('pubspec.lock', contains('1.0.0'))]) | 44 d.dir( |
51 ]) | 45 'global_packages', |
52 ]).validate(); | 46 [ |
| 47 d.nothing('foo.lock'), |
| 48 d.dir('foo', [d.matcherFile('pubspec.lock', contains('1.0.0'
))])])]).validate(); |
53 }); | 49 }); |
54 } | 50 } |
OLD | NEW |