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