OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:io'; | 5 import 'dart:io'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 | 7 |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:scheduled_test/scheduled_process.dart'; | 9 import 'package:scheduled_test/scheduled_process.dart'; |
10 import 'package:scheduled_test/scheduled_stream.dart'; | 10 import 'package:scheduled_test/scheduled_stream.dart'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 """; | 24 """; |
25 | 25 |
26 main() { | 26 main() { |
27 initConfig(); | 27 initConfig(); |
28 integration("an outdated binstub is replaced", () { | 28 integration("an outdated binstub is replaced", () { |
29 servePackages((builder) { | 29 servePackages((builder) { |
30 builder.serve("foo", "1.0.0", pubspec: { | 30 builder.serve("foo", "1.0.0", pubspec: { |
31 "executables": { | 31 "executables": { |
32 "foo-script": "script" | 32 "foo-script": "script" |
33 } | 33 } |
34 }, contents: [ | 34 }, |
35 d.dir("bin", [ | 35 contents: [ |
36 d.file("script.dart", "main(args) => print('ok \$args');") | 36 d.dir("bin", [d.file("script.dart", "main(args) => print('ok \$arg
s');")])]); |
37 ]) | |
38 ]); | |
39 }); | 37 }); |
40 | 38 |
41 schedulePub(args: ["global", "activate", "foo"]); | 39 schedulePub(args: ["global", "activate", "foo"]); |
42 | 40 |
43 d.dir(cachePath, [ | 41 d.dir( |
44 d.dir('bin', [ | 42 cachePath, |
45 d.file(binStubName('foo-script'), _OUTDATED_BINSTUB) | 43 [ |
46 ]) | 44 d.dir('bin', [d.file(binStubName('foo-script'), _OUTDATED_BINSTUB)])
]).create(); |
47 ]).create(); | |
48 | 45 |
49 schedulePub(args: ["global", "activate", "foo"]); | 46 schedulePub(args: ["global", "activate", "foo"]); |
50 | 47 |
51 d.dir(cachePath, [ | 48 d.dir( |
52 d.dir('bin', [ | 49 cachePath, |
53 // 255 is the VM's exit code upon seeing an out-of-date snapshot. | 50 [d.dir('bin', [// 255 is the VM's exit code upon seeing an out-of-date s
napshot. |
54 d.matcherFile(binStubName('foo-script'), contains("255")) | 51 d.matcherFile( |
55 ]) | 52 binStubName('foo-script'), |
56 ]).validate(); | 53 contains("255"))])]).validate(); |
57 }); | 54 }); |
58 } | 55 } |
OLD | NEW |