OLD | NEW |
(Empty) | |
| 1 library pub_tests; |
| 2 import 'package:path/path.dart' as p; |
| 3 import 'package:scheduled_test/scheduled_test.dart'; |
| 4 import '../descriptor.dart' as d; |
| 5 import '../test_pub.dart'; |
| 6 main() { |
| 7 initConfig(); |
| 8 integration("upgrades a snapshot when a dependency is upgraded", () { |
| 9 servePackages((builder) { |
| 10 builder.serve("foo", "1.2.3", pubspec: { |
| 11 "dependencies": { |
| 12 "bar": "any" |
| 13 } |
| 14 }, contents: [d.dir("bin", [d.file("hello.dart", """ |
| 15 import 'package:bar/bar.dart'; |
| 16 |
| 17 void main() => print(message); |
| 18 """)])]); |
| 19 builder.serve( |
| 20 "bar", |
| 21 "1.2.3", |
| 22 contents: [d.dir("lib", [d.file("bar.dart", "final message = 'hello!';
")])]); |
| 23 }); |
| 24 d.appDir({ |
| 25 "foo": "any" |
| 26 }).create(); |
| 27 pubGet(output: contains("Precompiled foo:hello.")); |
| 28 d.dir( |
| 29 p.join(appPath, '.pub', 'bin', 'foo'), |
| 30 [d.matcherFile('hello.dart.snapshot', contains('hello!'))]).validate(); |
| 31 servePackages((builder) { |
| 32 builder.serve( |
| 33 "bar", |
| 34 "1.2.4", |
| 35 contents: [d.dir("lib", [d.file("bar.dart", "final message = 'hello 2!
';")])]); |
| 36 }); |
| 37 pubUpgrade(output: contains("Precompiled foo:hello.")); |
| 38 d.dir( |
| 39 p.join(appPath, '.pub', 'bin', 'foo'), |
| 40 [d.matcherFile('hello.dart.snapshot', contains('hello 2!'))]).validate()
; |
| 41 var process = pubRun(args: ['foo:hello']); |
| 42 process.stdout.expect("hello 2!"); |
| 43 process.shouldExit(); |
| 44 }); |
| 45 } |
OLD | NEW |