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_stream.dart'; | |
10 import 'package:scheduled_test/scheduled_test.dart'; | |
11 | |
12 import '../../descriptor.dart' as d; | |
13 import '../../test_pub.dart'; | |
14 import 'utils.dart'; | |
15 | |
16 main() { | |
17 initConfig(); | |
18 integration("a binstub runs 'pub global run' for an outdated snapshot", () { | |
19 servePackages((builder) { | |
20 builder.serve("foo", "1.0.0", pubspec: { | |
21 "executables": { | |
22 "foo-script": "script" | |
23 } | |
24 }, contents: [ | |
25 d.dir("bin", [ | |
26 d.file("script.dart", "main(args) => print('ok \$args');") | |
27 ]) | |
28 ]); | |
29 }); | |
30 | |
31 schedulePub(args: ["global", "activate", "foo"]); | |
32 | |
33 d.dir(cachePath, [ | |
34 d.dir('global_packages', [ | |
35 d.dir('foo', [ | |
36 d.dir('bin', [d.outOfDateSnapshot('script.dart.snapshot')]) | |
37 ]) | |
38 ]) | |
39 ]).create(); | |
40 | |
41 var process = new ScheduledProcess.start( | |
42 p.join(sandboxDir, cachePath, "bin", binStubName("foo-script")), | |
43 ["arg1", "arg2"], | |
44 environment: getEnvironment()); | |
45 | |
46 // process.stderr.expect(startsWith("Wrong script snapshot version")); | |
47 // process.stdout.expect(consumeThrough("ok [arg1, arg2]")); | |
Bob Nystrom
2014/11/21 19:13:41
Delete?
nweiz
2014/11/22 02:32:56
Actually, uncomment.
| |
48 process.shouldExit(); | |
49 }); | |
50 } | |
OLD | NEW |