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