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( |
| 9 "creates a snapshot for an immediate dependency's executables", |
| 10 () { |
| 11 servePackages((builder) { |
| 12 builder.serve( |
| 13 "foo", |
| 14 "1.2.3", |
| 15 contents: [ |
| 16 d.dir( |
| 17 "bin", |
| 18 [ |
| 19 d.file("hello.dart", "void main() => print('hello!');"), |
| 20 d.file("goodbye.dart", "void main() => print('goodbye!');"
), |
| 21 d.file("shell.sh", "echo shell"), |
| 22 d.dir("subdir", [d.file("sub.dart", "void main() => print(
'sub!');")])])]); |
| 23 }); |
| 24 d.appDir({ |
| 25 "foo": "1.2.3" |
| 26 }).create(); |
| 27 pubGet( |
| 28 output: allOf( |
| 29 [contains("Precompiled foo:hello."), contains("Precompiled foo:goodb
ye.")])); |
| 30 d.dir( |
| 31 p.join(appPath, '.pub', 'bin'), |
| 32 [ |
| 33 d.file('sdk-version', '0.1.2+3\n'), |
| 34 d.dir( |
| 35 'foo', |
| 36 [ |
| 37 d.matcherFile('hello.dart.snapshot', contains('hello!')), |
| 38 d.matcherFile('goodbye.dart.snapshot', contains('goodbye!'))
, |
| 39 d.nothing('shell.sh.snapshot'), |
| 40 d.nothing('subdir')])]).validate(); |
| 41 var process = pubRun(args: ['foo:hello']); |
| 42 process.stdout.expect("hello!"); |
| 43 process.shouldExit(); |
| 44 process = pubRun(args: ['foo:goodbye']); |
| 45 process.stdout.expect("goodbye!"); |
| 46 process.shouldExit(); |
| 47 }); |
| 48 } |
OLD | NEW |