| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import 'dart:io'; | |
| 6 | |
| 7 import 'package:path/path.dart' as p; | |
| 8 import 'package:scheduled_test/scheduled_process.dart'; | |
| 9 import 'package:scheduled_test/scheduled_test.dart'; | |
| 10 | |
| 11 import '../../descriptor.dart' as d; | |
| 12 import '../../test_pub.dart'; | |
| 13 import 'utils.dart'; | |
| 14 | |
| 15 main() { | |
| 16 initConfig(); | |
| 17 integration("the generated binstub runs a snapshotted executable", () { | |
| 18 servePackages((builder) { | |
| 19 builder.serve("foo", "1.0.0", pubspec: { | |
| 20 "executables": { | |
| 21 "foo-script": "script" | |
| 22 } | |
| 23 }, | |
| 24 contents: [ | |
| 25 d.dir("bin", [d.file("script.dart", "main(args) => print('ok \$arg
s');")])]); | |
| 26 }); | |
| 27 | |
| 28 schedulePub(args: ["global", "activate", "foo"]); | |
| 29 | |
| 30 var process = new ScheduledProcess.start( | |
| 31 p.join(sandboxDir, cachePath, "bin", binStubName("foo-script")), | |
| 32 ["arg1", "arg2"], | |
| 33 environment: getEnvironment()); | |
| 34 | |
| 35 process.stdout.expect("ok [arg1, arg2]"); | |
| 36 process.shouldExit(); | |
| 37 }); | |
| 38 | |
| 39 integration("the generated binstub runs a non-snapshotted executable", () { | |
| 40 d.dir("foo", [d.pubspec({ | |
| 41 "name": "foo", | |
| 42 "executables": { | |
| 43 "foo-script": "script" | |
| 44 } | |
| 45 }), | |
| 46 d.dir( | |
| 47 "bin", | |
| 48 [d.file("script.dart", "main(args) => print('ok \$args');")])]).cr
eate(); | |
| 49 | |
| 50 schedulePub(args: ["global", "activate", "-spath", "../foo"]); | |
| 51 | |
| 52 var process = new ScheduledProcess.start( | |
| 53 p.join(sandboxDir, cachePath, "bin", binStubName("foo-script")), | |
| 54 ["arg1", "arg2"], | |
| 55 environment: getEnvironment()); | |
| 56 | |
| 57 process.stdout.expect("ok [arg1, arg2]"); | |
| 58 process.shouldExit(); | |
| 59 }); | |
| 60 } | |
| OLD | NEW |