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 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
11 import '../test_pub.dart'; | 11 import '../test_pub.dart'; |
12 | 12 |
13 main() { | 13 main() { |
14 initConfig(); | |
15 integration("upgrades a snapshot when a dependency is upgraded", () { | 14 integration("upgrades a snapshot when a dependency is upgraded", () { |
16 servePackages((builder) { | 15 servePackages((builder) { |
17 builder.serve("foo", "1.2.3", pubspec: { | 16 builder.serve("foo", "1.2.3", pubspec: { |
18 "dependencies": {"bar": "any"} | 17 "dependencies": {"bar": "any"} |
19 }, contents: [ | 18 }, contents: [ |
20 d.dir("bin", [ | 19 d.dir("bin", [ |
21 d.file("hello.dart", """ | 20 d.file("hello.dart", """ |
22 import 'package:bar/bar.dart'; | 21 import 'package:bar/bar.dart'; |
23 | 22 |
24 void main() => print(message); | 23 void main() => print(message); |
(...skipping 23 matching lines...) Expand all Loading... |
48 | 47 |
49 d.dir(p.join(appPath, '.pub', 'bin', 'foo'), [ | 48 d.dir(p.join(appPath, '.pub', 'bin', 'foo'), [ |
50 d.matcherFile('hello.dart.snapshot', contains('hello 2!')) | 49 d.matcherFile('hello.dart.snapshot', contains('hello 2!')) |
51 ]).validate(); | 50 ]).validate(); |
52 | 51 |
53 var process = pubRun(args: ['foo:hello']); | 52 var process = pubRun(args: ['foo:hello']); |
54 process.stdout.expect("hello 2!"); | 53 process.stdout.expect("hello 2!"); |
55 process.shouldExit(); | 54 process.shouldExit(); |
56 }); | 55 }); |
57 } | 56 } |
OLD | NEW |