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 its package is upgraded", () { |
| 9 servePackages((builder) { |
| 10 builder.serve( |
| 11 "foo", |
| 12 "1.2.3", |
| 13 contents: [ |
| 14 d.dir("bin", [d.file("hello.dart", "void main() => print('hello!')
;")])]); |
| 15 }); |
| 16 d.appDir({ |
| 17 "foo": "any" |
| 18 }).create(); |
| 19 pubGet(output: contains("Precompiled foo:hello.")); |
| 20 d.dir( |
| 21 p.join(appPath, '.pub', 'bin', 'foo'), |
| 22 [d.matcherFile('hello.dart.snapshot', contains('hello!'))]).validate(); |
| 23 servePackages((builder) { |
| 24 builder.serve( |
| 25 "foo", |
| 26 "1.2.4", |
| 27 contents: [ |
| 28 d.dir("bin", [d.file("hello.dart", "void main() => print('hello 2!
');")])]); |
| 29 }); |
| 30 pubUpgrade(output: contains("Precompiled foo:hello.")); |
| 31 d.dir( |
| 32 p.join(appPath, '.pub', 'bin', 'foo'), |
| 33 [d.matcherFile('hello.dart.snapshot', contains('hello 2!'))]).validate()
; |
| 34 var process = pubRun(args: ['foo:hello']); |
| 35 process.stdout.expect("hello 2!"); |
| 36 process.shouldExit(); |
| 37 }); |
| 38 } |
OLD | NEW |