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 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
6 | 6 |
7 import '../../descriptor.dart' as d; | 7 import '../../descriptor.dart' as d; |
8 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
9 import 'utils.dart'; | 9 import 'utils.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 initConfig(); | 12 initConfig(); |
13 integration("removes all binstubs for package", () { | 13 integration("removes all binstubs for package", () { |
14 d.dir("foo", [ | 14 d.dir("foo", [d.pubspec({ |
15 d.pubspec({ | |
16 "name": "foo", | 15 "name": "foo", |
17 "executables": { | 16 "executables": { |
18 "foo": null | 17 "foo": null |
19 } | 18 } |
20 }), | 19 }), |
21 d.dir("bin", [ | 20 d.dir("bin", [d.file("foo.dart", "main() => print('ok');")])]).create(
); |
22 d.file("foo.dart", "main() => print('ok');") | |
23 ]) | |
24 ]).create(); | |
25 | 21 |
26 // Create the binstub for foo. | 22 // Create the binstub for foo. |
27 schedulePub(args: ["global", "activate", "--source", "path", "../foo"]); | 23 schedulePub(args: ["global", "activate", "--source", "path", "../foo"]); |
28 | 24 |
29 // Remove it from the pubspec. | 25 // Remove it from the pubspec. |
30 d.dir("foo", [ | 26 d.dir("foo", [d.pubspec({ |
31 d.pubspec({ | |
32 "name": "foo" | 27 "name": "foo" |
33 }) | 28 })]).create(); |
34 ]).create(); | |
35 | 29 |
36 // Deactivate. | 30 // Deactivate. |
37 schedulePub(args: ["global", "deactivate", "foo"]); | 31 schedulePub(args: ["global", "deactivate", "foo"]); |
38 | 32 |
39 // It should still be deleted. | 33 // It should still be deleted. |
40 d.dir(cachePath, [ | 34 d.dir( |
41 d.dir("bin", [ | 35 cachePath, |
42 d.nothing(binStubName("foo")) | 36 [d.dir("bin", [d.nothing(binStubName("foo"))])]).validate(); |
43 ]) | |
44 ]).validate(); | |
45 }); | 37 }); |
46 } | 38 } |
OLD | NEW |