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 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
8 | 8 |
9 import '../lib/src/exit_codes.dart' as exit_codes; | 9 import '../lib/src/exit_codes.dart' as exit_codes; |
10 import 'test_pub.dart'; | 10 import 'test_pub.dart'; |
(...skipping 10 matching lines...) Expand all Loading... |
21 --verbosity Control output verbosity. | 21 --verbosity Control output verbosity. |
22 | 22 |
23 [all] Show all output including internal tracing messages. | 23 [all] Show all output including internal tracing messages. |
24 [io] Also show IO operations. | 24 [io] Also show IO operations. |
25 [normal] Show errors, warnings, and user messages. | 25 [normal] Show errors, warnings, and user messages. |
26 [solver] Show steps during version resolution. | 26 [solver] Show steps during version resolution. |
27 | 27 |
28 -v, --verbose Shortcut for "--verbosity=all". | 28 -v, --verbose Shortcut for "--verbosity=all". |
29 | 29 |
30 Available commands: | 30 Available commands: |
31 build Apply transformers to build a package. | 31 build Apply transformers to build a package. |
32 cache Work with the system cache. | 32 cache Work with the system cache. |
33 deps Print package dependencies. | 33 deps Print package dependencies. |
34 get Get the current package's dependencies. | 34 downgrade Downgrade the current package's dependencies to oldest version
s. |
35 global Work with global packages. | 35 get Get the current package's dependencies. |
36 help Display help information for Pub. | 36 global Work with global packages. |
37 publish Publish the current package to pub.dartlang.org. | 37 help Display help information for Pub. |
38 run Run an executable from a package. | 38 publish Publish the current package to pub.dartlang.org. |
39 serve Run a local web development server. | 39 run Run an executable from a package. |
40 upgrade Upgrade the current package's dependencies to latest versions. | 40 serve Run a local web development server. |
41 uploader Manage uploaders for a package on pub.dartlang.org. | 41 upgrade Upgrade the current package's dependencies to latest versions. |
42 version Print pub version. | 42 uploader Manage uploaders for a package on pub.dartlang.org. |
| 43 version Print pub version. |
43 | 44 |
44 Run "pub help [command]" for more information about a command. | 45 Run "pub help [command]" for more information about a command. |
45 See http://dartlang.org/tools/pub for detailed documentation. | 46 See http://dartlang.org/tools/pub for detailed documentation. |
46 """; | 47 """; |
47 | 48 |
48 final VERSION_STRING = ''' | 49 final VERSION_STRING = ''' |
49 Pub 0.1.2+3 | 50 Pub 0.1.2+3 |
50 '''; | 51 '''; |
51 | 52 |
52 main() { | 53 main() { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 integration('running pub with just --version displays version', () { | 121 integration('running pub with just --version displays version', () { |
121 schedulePub(args: ['--version'], output: VERSION_STRING); | 122 schedulePub(args: ['--version'], output: VERSION_STRING); |
122 }); | 123 }); |
123 | 124 |
124 integration('an unknown command displays an error message', () { | 125 integration('an unknown command displays an error message', () { |
125 schedulePub(args: ['quylthulg'], | 126 schedulePub(args: ['quylthulg'], |
126 error: ''' | 127 error: ''' |
127 Could not find a command named "quylthulg". | 128 Could not find a command named "quylthulg". |
128 | 129 |
129 Available commands: | 130 Available commands: |
130 build Apply transformers to build a package. | 131 build Apply transformers to build a package. |
131 cache Work with the system cache. | 132 cache Work with the system cache. |
132 deps Print package dependencies. | 133 deps Print package dependencies. |
133 get Get the current package's dependencies. | 134 downgrade Downgrade the current package's dependencies to oldest ver
sions. |
134 global Work with global packages. | 135 get Get the current package's dependencies. |
135 help Display help information for Pub. | 136 global Work with global packages. |
136 publish Publish the current package to pub.dartlang.org. | 137 help Display help information for Pub. |
137 run Run an executable from a package. | 138 publish Publish the current package to pub.dartlang.org. |
138 serve Run a local web development server. | 139 run Run an executable from a package. |
139 upgrade Upgrade the current package's dependencies to latest versio
ns. | 140 serve Run a local web development server. |
140 uploader Manage uploaders for a package on pub.dartlang.org. | 141 upgrade Upgrade the current package's dependencies to latest versi
ons. |
141 version Print pub version. | 142 uploader Manage uploaders for a package on pub.dartlang.org. |
| 143 version Print pub version. |
142 ''', | 144 ''', |
143 exitCode: exit_codes.USAGE); | 145 exitCode: exit_codes.USAGE); |
144 }); | 146 }); |
145 | 147 |
146 integration('an unknown subcommand displays an error message', () { | 148 integration('an unknown subcommand displays an error message', () { |
147 schedulePub(args: ['cache', 'quylthulg'], | 149 schedulePub(args: ['cache', 'quylthulg'], |
148 error: ''' | 150 error: ''' |
149 Could not find a subcommand named "quylthulg" for "pub cache". | 151 Could not find a subcommand named "quylthulg" for "pub cache". |
150 | 152 |
151 Usage: pub cache <subcommand> | 153 Usage: pub cache <subcommand> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 Run "pub help" to see global options. | 292 Run "pub help" to see global options. |
291 '''); | 293 '''); |
292 }); | 294 }); |
293 | 295 |
294 integration('an unknown help command displays an error message', () { | 296 integration('an unknown help command displays an error message', () { |
295 schedulePub(args: ['help', 'quylthulg'], | 297 schedulePub(args: ['help', 'quylthulg'], |
296 error: ''' | 298 error: ''' |
297 Could not find a command named "quylthulg". | 299 Could not find a command named "quylthulg". |
298 | 300 |
299 Available commands: | 301 Available commands: |
300 build Apply transformers to build a package. | 302 build Apply transformers to build a package. |
301 cache Work with the system cache. | 303 cache Work with the system cache. |
302 deps Print package dependencies. | 304 deps Print package dependencies. |
303 get Get the current package's dependencies. | 305 downgrade Downgrade the current package's dependencies to oldest
versions. |
304 global Work with global packages. | 306 get Get the current package's dependencies. |
305 help Display help information for Pub. | 307 global Work with global packages. |
306 publish Publish the current package to pub.dartlang.org. | 308 help Display help information for Pub. |
307 run Run an executable from a package. | 309 publish Publish the current package to pub.dartlang.org. |
308 serve Run a local web development server. | 310 run Run an executable from a package. |
309 upgrade Upgrade the current package's dependencies to latest ve
rsions. | 311 serve Run a local web development server. |
310 uploader Manage uploaders for a package on pub.dartlang.org. | 312 upgrade Upgrade the current package's dependencies to latest v
ersions. |
311 version Print pub version. | 313 uploader Manage uploaders for a package on pub.dartlang.org. |
| 314 version Print pub version. |
312 ''', | 315 ''', |
313 exitCode: exit_codes.USAGE); | 316 exitCode: exit_codes.USAGE); |
314 }); | 317 }); |
315 | 318 |
316 integration('an unknown help subcommand displays an error message', () { | 319 integration('an unknown help subcommand displays an error message', () { |
317 schedulePub(args: ['help', 'cache', 'quylthulg'], | 320 schedulePub(args: ['help', 'cache', 'quylthulg'], |
318 error: ''' | 321 error: ''' |
319 Could not find a subcommand named "quylthulg" for "pub cache". | 322 Could not find a subcommand named "quylthulg" for "pub cache". |
320 | 323 |
321 Usage: pub cache <subcommand> | 324 Usage: pub cache <subcommand> |
(...skipping 22 matching lines...) Expand all Loading... |
344 exitCode: exit_codes.USAGE); | 347 exitCode: exit_codes.USAGE); |
345 }); | 348 }); |
346 }); | 349 }); |
347 | 350 |
348 group('version', () { | 351 group('version', () { |
349 integration('displays the current version', () { | 352 integration('displays the current version', () { |
350 schedulePub(args: ['version'], output: VERSION_STRING); | 353 schedulePub(args: ['version'], output: VERSION_STRING); |
351 }); | 354 }); |
352 }); | 355 }); |
353 } | 356 } |
OLD | NEW |