| OLD | NEW |
| 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 'package:path/path.dart' as p; | 1 import 'package:path/path.dart' as p; |
| 6 | |
| 7 import '../../../lib/src/exit_codes.dart' as exit_codes; | 2 import '../../../lib/src/exit_codes.dart' as exit_codes; |
| 8 import '../../descriptor.dart' as d; | 3 import '../../descriptor.dart' as d; |
| 9 import '../../test_pub.dart'; | 4 import '../../test_pub.dart'; |
| 10 | |
| 11 main() { | 5 main() { |
| 12 initConfig(); | 6 initConfig(); |
| 13 integration('errors if the script is in a subdirectory.', () { | 7 integration('errors if the script is in a subdirectory.', () { |
| 14 servePackages((builder) { | 8 servePackages((builder) { |
| 15 builder.serve("foo", "1.0.0", contents: [ | 9 builder.serve( |
| 16 d.dir("example", [ | 10 "foo", |
| 17 d.file("script.dart", "main(args) => print('ok');") | 11 "1.0.0", |
| 18 ]) | 12 contents: [ |
| 19 ]); | 13 d.dir("example", [d.file("script.dart", "main(args) => print('ok')
;")])]); |
| 20 }); | 14 }); |
| 21 | |
| 22 schedulePub(args: ["global", "activate", "foo"]); | 15 schedulePub(args: ["global", "activate", "foo"]); |
| 23 schedulePub(args: ["global", "run", "foo:example/script"], | 16 schedulePub(args: ["global", "run", "foo:example/script"], error: """ |
| 24 error: """ | |
| 25 Cannot run an executable in a subdirectory of a global package. | 17 Cannot run an executable in a subdirectory of a global package. |
| 26 | 18 |
| 27 Usage: pub global run <package>:<executable> [args...] | 19 Usage: pub global run <package>:<executable> [args...] |
| 28 -h, --help Print usage information for this command. | 20 -h, --help Print usage information for this command. |
| 29 | 21 |
| 30 Run "pub help" to see global options. | 22 Run "pub help" to see global options. |
| 31 """, | 23 """, exitCode: exit_codes.USAGE); |
| 32 exitCode: exit_codes.USAGE); | |
| 33 }); | 24 }); |
| 34 } | 25 } |
| OLD | NEW |