| 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 12 matching lines...) Expand all Loading... |
| 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 get Get the current package's dependencies. | 34 get Get the current package's dependencies. |
| 34 help Display help information for Pub. | 35 help Display help information for Pub. |
| 35 publish Publish the current package to pub.dartlang.org. | 36 publish Publish the current package to pub.dartlang.org. |
| 36 serve Run a local web development server. | 37 serve Run a local web development server. |
| 37 upgrade Upgrade the current package's dependencies to latest versions. | 38 upgrade Upgrade the current package's dependencies to latest versions. |
| 38 uploader Manage uploaders for a package on pub.dartlang.org. | 39 uploader Manage uploaders for a package on pub.dartlang.org. |
| 39 version Print pub version. | 40 version Print pub version. |
| 40 | 41 |
| 41 Use "pub help [command]" for more information about a command. | 42 Use "pub help [command]" for more information about a command. |
| 42 """; | 43 """; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 -h, --help Print usage information for this command. | 81 -h, --help Print usage information for this command. |
| 81 --[no-]offline Use cached packages instead of accessing the net
work. | 82 --[no-]offline Use cached packages instead of accessing the net
work. |
| 82 '''); | 83 '''); |
| 83 }); | 84 }); |
| 84 | 85 |
| 85 integration('running pub with --help after a command with subcommands shows ' | 86 integration('running pub with --help after a command with subcommands shows ' |
| 86 'command usage', () { | 87 'command usage', () { |
| 87 schedulePub(args: ['cache', '--help'], | 88 schedulePub(args: ['cache', '--help'], |
| 88 output: ''' | 89 output: ''' |
| 89 Work with the system cache. | 90 Work with the system cache. |
| 90 | 91 |
| 91 Usage: pub cache <subcommand> | 92 Usage: pub cache <subcommand> |
| 92 -h, --help Print usage information for this command. | 93 -h, --help Print usage information for this command. |
| 93 | 94 |
| 94 Available subcommands: | 95 Available subcommands: |
| 95 add Install a package. | 96 add Install a package. |
| 96 '''); | 97 '''); |
| 97 }); | 98 }); |
| 98 | 99 |
| 99 | 100 |
| 100 integration('running pub with just --version displays version', () { | 101 integration('running pub with just --version displays version', () { |
| 101 schedulePub(args: ['--version'], output: VERSION_STRING); | 102 schedulePub(args: ['--version'], output: VERSION_STRING); |
| 102 }); | 103 }); |
| 103 | 104 |
| 104 integration('an unknown command displays an error message', () { | 105 integration('an unknown command displays an error message', () { |
| 105 schedulePub(args: ['quylthulg'], | 106 schedulePub(args: ['quylthulg'], |
| 106 error: ''' | 107 error: ''' |
| 107 Could not find a command named "quylthulg". | 108 Could not find a command named "quylthulg". |
| 108 | 109 |
| 109 Available commands: | 110 Available commands: |
| 110 build Apply transformers to build a package. | 111 build Apply transformers to build a package. |
| 111 cache Work with the system cache. | 112 cache Work with the system cache. |
| 113 deps Print package dependencies. |
| 112 get Get the current package's dependencies. | 114 get Get the current package's dependencies. |
| 113 help Display help information for Pub. | 115 help Display help information for Pub. |
| 114 publish Publish the current package to pub.dartlang.org. | 116 publish Publish the current package to pub.dartlang.org. |
| 115 serve Run a local web development server. | 117 serve Run a local web development server. |
| 116 upgrade Upgrade the current package's dependencies to latest versio
ns. | 118 upgrade Upgrade the current package's dependencies to latest versio
ns. |
| 117 uploader Manage uploaders for a package on pub.dartlang.org. | 119 uploader Manage uploaders for a package on pub.dartlang.org. |
| 118 version Print pub version. | 120 version Print pub version. |
| 119 ''', | 121 ''', |
| 120 exitCode: exit_codes.USAGE); | 122 exitCode: exit_codes.USAGE); |
| 121 }); | 123 }); |
| 122 | 124 |
| 123 integration('an unknown subcommand displays an error message', () { | 125 integration('an unknown subcommand displays an error message', () { |
| 124 schedulePub(args: ['cache', 'quylthulg'], | 126 schedulePub(args: ['cache', 'quylthulg'], |
| 125 error: ''' | 127 error: ''' |
| 126 Could not find a subcommand named "quylthulg" for "pub cache". | 128 Could not find a subcommand named "quylthulg" for "pub cache". |
| 127 | 129 |
| 128 Usage: pub cache <subcommand> | 130 Usage: pub cache <subcommand> |
| 129 -h, --help Print usage information for this command. | 131 -h, --help Print usage information for this command. |
| 130 | 132 |
| 131 Available subcommands: | 133 Available subcommands: |
| 132 add Install a package. | 134 add Install a package. |
| 133 ''', | 135 ''', |
| 134 exitCode: exit_codes.USAGE); | 136 exitCode: exit_codes.USAGE); |
| 135 }); | 137 }); |
| 136 | 138 |
| 137 integration('an unknown option displays an error message', () { | 139 integration('an unknown option displays an error message', () { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 --server The package server to which to upload this package. | 209 --server The package server to which to upload this package. |
| 208 (defaults to "https://pub.dartlang.org") | 210 (defaults to "https://pub.dartlang.org") |
| 209 '''); | 211 '''); |
| 210 }); | 212 }); |
| 211 | 213 |
| 212 integration('shows non-truncated help', () { | 214 integration('shows non-truncated help', () { |
| 213 schedulePub(args: ['help', 'serve'], | 215 schedulePub(args: ['help', 'serve'], |
| 214 output: ''' | 216 output: ''' |
| 215 Run a local web development server. | 217 Run a local web development server. |
| 216 | 218 |
| 217 By default, this serves "web/" and "test/", but an explicit list of | 219 By default, this serves "web/" and "test/", but an explicit list of |
| 218 directories to serve can be provided as well. | 220 directories to serve can be provided as well. |
| 219 | 221 |
| 220 Usage: pub serve [directories...] | 222 Usage: pub serve [directories...] |
| 221 -h, --help Print usage information for this command. | 223 -h, --help Print usage information for this command. |
| 222 --hostname The hostname to listen on. | 224 --hostname The hostname to listen on. |
| 223 (defaults to "localhost") | 225 (defaults to "localhost") |
| 224 | 226 |
| 225 --port The base port to listen on. | 227 --port The base port to listen on. |
| 226 (defaults to "8080") | 228 (defaults to "8080") |
| 227 | 229 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 245 }); | 247 }); |
| 246 | 248 |
| 247 integration('an unknown help command displays an error message', () { | 249 integration('an unknown help command displays an error message', () { |
| 248 schedulePub(args: ['help', 'quylthulg'], | 250 schedulePub(args: ['help', 'quylthulg'], |
| 249 error: ''' | 251 error: ''' |
| 250 Could not find a command named "quylthulg". | 252 Could not find a command named "quylthulg". |
| 251 | 253 |
| 252 Available commands: | 254 Available commands: |
| 253 build Apply transformers to build a package. | 255 build Apply transformers to build a package. |
| 254 cache Work with the system cache. | 256 cache Work with the system cache. |
| 257 deps Print package dependencies. |
| 255 get Get the current package's dependencies. | 258 get Get the current package's dependencies. |
| 256 help Display help information for Pub. | 259 help Display help information for Pub. |
| 257 publish Publish the current package to pub.dartlang.org. | 260 publish Publish the current package to pub.dartlang.org. |
| 258 serve Run a local web development server. | 261 serve Run a local web development server. |
| 259 upgrade Upgrade the current package's dependencies to latest ve
rsions. | 262 upgrade Upgrade the current package's dependencies to latest ve
rsions. |
| 260 uploader Manage uploaders for a package on pub.dartlang.org. | 263 uploader Manage uploaders for a package on pub.dartlang.org. |
| 261 version Print pub version. | 264 version Print pub version. |
| 262 ''', | 265 ''', |
| 263 exitCode: exit_codes.USAGE); | 266 exitCode: exit_codes.USAGE); |
| 264 }); | 267 }); |
| 265 | 268 |
| 266 integration('an unknown help subcommand displays an error message', () { | 269 integration('an unknown help subcommand displays an error message', () { |
| 267 schedulePub(args: ['help', 'cache', 'quylthulg'], | 270 schedulePub(args: ['help', 'cache', 'quylthulg'], |
| 268 error: ''' | 271 error: ''' |
| 269 Could not find a subcommand named "quylthulg" for "pub cache". | 272 Could not find a subcommand named "quylthulg" for "pub cache". |
| 270 | 273 |
| 271 Usage: pub cache <subcommand> | 274 Usage: pub cache <subcommand> |
| 272 -h, --help Print usage information for this command. | 275 -h, --help Print usage information for this command. |
| 273 | 276 |
| 274 Available subcommands: | 277 Available subcommands: |
| 275 add Install a package. | 278 add Install a package. |
| 276 ''', | 279 ''', |
| 277 exitCode: exit_codes.USAGE); | 280 exitCode: exit_codes.USAGE); |
| 278 }); | 281 }); |
| 279 | 282 |
| 280 integration('an unexpected help subcommand displays an error message', () { | 283 integration('an unexpected help subcommand displays an error message', () { |
| 281 schedulePub(args: ['help', 'version', 'badsubcommand'], | 284 schedulePub(args: ['help', 'version', 'badsubcommand'], |
| 282 error: ''' | 285 error: ''' |
| 283 Command "pub version" does not expect a subcommand. | 286 Command "pub version" does not expect a subcommand. |
| 284 | 287 |
| 285 Usage: pub version | 288 Usage: pub version |
| 286 -h, --help Print usage information for this command. | 289 -h, --help Print usage information for this command. |
| 287 ''', | 290 ''', |
| 288 exitCode: exit_codes.USAGE); | 291 exitCode: exit_codes.USAGE); |
| 289 }); | 292 }); |
| 290 }); | 293 }); |
| 291 | 294 |
| 292 group('version', () { | 295 group('version', () { |
| 293 integration('displays the current version', () { | 296 integration('displays the current version', () { |
| 294 schedulePub(args: ['version'], output: VERSION_STRING); | 297 schedulePub(args: ['version'], output: VERSION_STRING); |
| 295 }); | 298 }); |
| 296 }); | 299 }); |
| 297 } | 300 } |
| OLD | NEW |