OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'test_pub.dart'; | 9 import 'test_pub.dart'; |
10 import '../../../pkg/unittest/lib/unittest.dart'; | 10 import '../../../pkg/unittest/lib/unittest.dart'; |
11 | 11 |
12 final USAGE_STRING = """ | 12 final USAGE_STRING = """ |
13 Pub is a package manager for Dart. | 13 Pub is a package manager for Dart. |
14 | 14 |
15 Usage: pub command [arguments] | 15 Usage: pub command [arguments] |
16 | 16 |
17 Global options: | 17 Global options: |
18 -h, --help Print this usage information. | 18 -h, --help Print this usage information. |
19 --version Print pub version. | 19 --version Print pub version. |
20 --[no-]trace Print debugging information when an error occurs. | 20 --[no-]trace Print debugging information when an error occurs. |
21 --verbosity Control output verbosity. | 21 --verbosity Control output verbosity. |
22 | 22 |
23 [all] All output including internal tracing messages are sho
wn. | 23 [all] All output including internal tracing messages are sho
wn. |
24 [io] IO operations are also shown. | 24 [io] IO operations are also shown. |
25 [normal] Errors, warnings, and user messages are shown. | 25 [normal] Errors, warnings, and user messages are shown. |
26 | 26 |
27 -v, --verbose Shortcut for "--verbosity=all" | 27 -v, --verbose Shortcut for "--verbosity=all" |
28 | 28 |
29 Available commands: | 29 Available commands: |
30 help Display help information for Pub. | 30 help Display help information for Pub. |
31 install Install the current package's dependencies. | 31 install Install the current package's dependencies. |
32 publish Publish the current package to pub.dartlang.org. | 32 publish Publish the current package to pub.dartlang.org. |
33 update Update the current package's dependencies to the latest versions
. | 33 update Update the current package's dependencies to the latest version
s. |
34 version Print pub version. | 34 uploader Manage uploaders for a package on pub.dartlang.org. |
| 35 version Print pub version. |
35 | 36 |
36 Use "pub help [command]" for more information about a command. | 37 Use "pub help [command]" for more information about a command. |
37 """; | 38 """; |
38 | 39 |
39 final VERSION_STRING = ''' | 40 final VERSION_STRING = ''' |
40 Pub 0.0.0 | 41 Pub 0.0.0 |
41 '''; | 42 '''; |
42 | 43 |
43 main() { | 44 main() { |
44 test('running pub with no command displays usage', () => | 45 test('running pub with no command displays usage', () => |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Run "pub help" to see available commands. | 111 Run "pub help" to see available commands. |
111 ''', | 112 ''', |
112 exitCode: 64); | 113 exitCode: 64); |
113 }); | 114 }); |
114 | 115 |
115 }); | 116 }); |
116 | 117 |
117 test('displays the current version', () => | 118 test('displays the current version', () => |
118 runPub(args: ['version'], output: VERSION_STRING)); | 119 runPub(args: ['version'], output: VERSION_STRING)); |
119 } | 120 } |
OLD | NEW |