| Index: sdk/lib/_internal/pub_generated/test/pub_test.dart
|
| diff --git a/sdk/lib/_internal/pub/test/pub_test.dart b/sdk/lib/_internal/pub_generated/test/pub_test.dart
|
| similarity index 85%
|
| copy from sdk/lib/_internal/pub/test/pub_test.dart
|
| copy to sdk/lib/_internal/pub_generated/test/pub_test.dart
|
| index 525cd0fd0ecea58aac8262176e5805bbb286e642..e0ca7d39b9d947304ef89e07aa086b28b41d5577 100644
|
| --- a/sdk/lib/_internal/pub/test/pub_test.dart
|
| +++ b/sdk/lib/_internal/pub_generated/test/pub_test.dart
|
| @@ -1,14 +1,7 @@
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| -// for details. All rights reserved. Use of this source code is governed by a
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| library pub_tests;
|
| -
|
| import 'package:scheduled_test/scheduled_test.dart';
|
| -
|
| import '../lib/src/exit_codes.dart' as exit_codes;
|
| import 'test_pub.dart';
|
| -
|
| final USAGE_STRING = """
|
| Pub is a package manager for Dart.
|
|
|
| @@ -45,33 +38,25 @@ final USAGE_STRING = """
|
| Run "pub help [command]" for more information about a command.
|
| See http://dartlang.org/tools/pub for detailed documentation.
|
| """;
|
| -
|
| final VERSION_STRING = '''
|
| Pub 0.1.2+3
|
| ''';
|
| -
|
| main() {
|
| initConfig();
|
| -
|
| integration('running pub with no command displays usage', () {
|
| schedulePub(args: [], output: USAGE_STRING);
|
| });
|
| -
|
| integration('running pub with just --help displays usage', () {
|
| schedulePub(args: ['--help'], output: USAGE_STRING);
|
| });
|
| -
|
| integration('running pub with just -h displays usage', () {
|
| schedulePub(args: ['-h'], output: USAGE_STRING);
|
| });
|
| -
|
| integration('running pub with --with-prejudice upcases everything', () {
|
| schedulePub(args: ['--with-prejudice'], output: USAGE_STRING.toUpperCase());
|
| });
|
| -
|
| integration('running pub with --help after command shows command usage', () {
|
| - schedulePub(args: ['get', '--help'],
|
| - output: '''
|
| + schedulePub(args: ['get', '--help'], output: '''
|
| Get the current package's dependencies.
|
|
|
| Usage: pub get
|
| @@ -83,10 +68,8 @@ main() {
|
| See http://dartlang.org/tools/pub/cmd/pub-get.html for detailed documentation.
|
| ''');
|
| });
|
| -
|
| integration('running pub with -h after command shows command usage', () {
|
| - schedulePub(args: ['get', '-h'],
|
| - output: '''
|
| + schedulePub(args: ['get', '-h'], output: '''
|
| Get the current package's dependencies.
|
|
|
| Usage: pub get
|
| @@ -98,11 +81,11 @@ main() {
|
| See http://dartlang.org/tools/pub/cmd/pub-get.html for detailed documentation.
|
| ''');
|
| });
|
| -
|
| - integration('running pub with --help after a command with subcommands shows '
|
| - 'command usage', () {
|
| - schedulePub(args: ['cache', '--help'],
|
| - output: '''
|
| + integration(
|
| + 'running pub with --help after a command with subcommands shows '
|
| + 'command usage',
|
| + () {
|
| + schedulePub(args: ['cache', '--help'], output: '''
|
| Work with the system cache.
|
|
|
| Usage: pub cache <subcommand>
|
| @@ -116,15 +99,11 @@ main() {
|
| See http://dartlang.org/tools/pub/cmd/pub-cache.html for detailed documentation.
|
| ''');
|
| });
|
| -
|
| -
|
| integration('running pub with just --version displays version', () {
|
| schedulePub(args: ['--version'], output: VERSION_STRING);
|
| });
|
| -
|
| integration('an unknown command displays an error message', () {
|
| - schedulePub(args: ['quylthulg'],
|
| - error: '''
|
| + schedulePub(args: ['quylthulg'], error: '''
|
| Could not find a command named "quylthulg".
|
|
|
| Available commands:
|
| @@ -141,13 +120,10 @@ main() {
|
| upgrade Upgrade the current package's dependencies to latest versions.
|
| uploader Manage uploaders for a package on pub.dartlang.org.
|
| version Print pub version.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('an unknown subcommand displays an error message', () {
|
| - schedulePub(args: ['cache', 'quylthulg'],
|
| - error: '''
|
| + schedulePub(args: ['cache', 'quylthulg'], error: '''
|
| Could not find a subcommand named "quylthulg" for "pub cache".
|
|
|
| Usage: pub cache <subcommand>
|
| @@ -159,46 +135,32 @@ main() {
|
|
|
| Run "pub help" to see global options.
|
| See http://dartlang.org/tools/pub/cmd/pub-cache.html for detailed documentation.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('an unknown option displays an error message', () {
|
| - schedulePub(args: ['--blorf'],
|
| - error: '''
|
| + schedulePub(args: ['--blorf'], error: '''
|
| Could not find an option named "blorf".
|
| Run "pub help" to see available options.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('an unknown command option displays an error message', () {
|
| - // TODO(rnystrom): When pub has command-specific options, a more precise
|
| - // error message would be good here.
|
| - schedulePub(args: ['version', '--blorf'],
|
| - error: '''
|
| + schedulePub(args: ['version', '--blorf'], error: '''
|
| Could not find an option named "blorf".
|
| Run "pub help" to see available options.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('an unexpected argument displays an error message', () {
|
| - schedulePub(args: ['version', 'unexpected'],
|
| - error: '''
|
| + schedulePub(args: ['version', 'unexpected'], error: '''
|
| Command "version" does not take any arguments.
|
|
|
| Usage: pub version
|
| -h, --help Print usage information for this command.
|
|
|
| Run "pub help" to see global options.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('a missing subcommand displays an error message', () {
|
| - schedulePub(args: ['cache'],
|
| - error: '''
|
| + schedulePub(args: ['cache'], error: '''
|
| Missing subcommand for "pub cache".
|
|
|
| Usage: pub cache <subcommand>
|
| @@ -210,18 +172,14 @@ main() {
|
|
|
| Run "pub help" to see global options.
|
| See http://dartlang.org/tools/pub/cmd/pub-cache.html for detailed documentation.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| group('help', () {
|
| integration('shows global help if no command is given', () {
|
| schedulePub(args: ['help'], output: USAGE_STRING);
|
| });
|
| -
|
| integration('shows help for a command', () {
|
| - schedulePub(args: ['help', 'get'],
|
| - output: '''
|
| + schedulePub(args: ['help', 'get'], output: '''
|
| Get the current package's dependencies.
|
|
|
| Usage: pub get
|
| @@ -233,10 +191,8 @@ main() {
|
| See http://dartlang.org/tools/pub/cmd/pub-get.html for detailed documentation.
|
| ''');
|
| });
|
| -
|
| integration('shows help for a command', () {
|
| - schedulePub(args: ['help', 'publish'],
|
| - output: '''
|
| + schedulePub(args: ['help', 'publish'], output: '''
|
| Publish the current package to pub.dartlang.org.
|
|
|
| Usage: pub publish [options]
|
| @@ -250,10 +206,8 @@ main() {
|
| See http://dartlang.org/tools/pub/cmd/pub-lish.html for detailed documentation.
|
| ''');
|
| });
|
| -
|
| integration('shows non-truncated help', () {
|
| - schedulePub(args: ['help', 'serve'],
|
| - output: '''
|
| + schedulePub(args: ['help', 'serve'], output: '''
|
| Run a local web development server.
|
|
|
| By default, this serves "web/" and "test/", but an explicit list of
|
| @@ -280,10 +234,8 @@ main() {
|
| See http://dartlang.org/tools/pub/cmd/pub-serve.html for detailed documentation.
|
| ''');
|
| });
|
| -
|
| integration('shows help for a subcommand', () {
|
| - schedulePub(args: ['help', 'cache', 'list'],
|
| - output: '''
|
| + schedulePub(args: ['help', 'cache', 'list'], output: '''
|
| List packages in the system cache.
|
|
|
| Usage: pub cache list
|
| @@ -292,10 +244,8 @@ main() {
|
| Run "pub help" to see global options.
|
| ''');
|
| });
|
| -
|
| integration('an unknown help command displays an error message', () {
|
| - schedulePub(args: ['help', 'quylthulg'],
|
| - error: '''
|
| + schedulePub(args: ['help', 'quylthulg'], error: '''
|
| Could not find a command named "quylthulg".
|
|
|
| Available commands:
|
| @@ -312,13 +262,10 @@ main() {
|
| upgrade Upgrade the current package's dependencies to latest versions.
|
| uploader Manage uploaders for a package on pub.dartlang.org.
|
| version Print pub version.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('an unknown help subcommand displays an error message', () {
|
| - schedulePub(args: ['help', 'cache', 'quylthulg'],
|
| - error: '''
|
| + schedulePub(args: ['help', 'cache', 'quylthulg'], error: '''
|
| Could not find a subcommand named "quylthulg" for "pub cache".
|
|
|
| Usage: pub cache <subcommand>
|
| @@ -330,24 +277,19 @@ main() {
|
|
|
| Run "pub help" to see global options.
|
| See http://dartlang.org/tools/pub/cmd/pub-cache.html for detailed documentation.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| -
|
| integration('an unexpected help subcommand displays an error message', () {
|
| - schedulePub(args: ['help', 'version', 'badsubcommand'],
|
| - error: '''
|
| + schedulePub(args: ['help', 'version', 'badsubcommand'], error: '''
|
| Command "pub version" does not expect a subcommand.
|
|
|
| Usage: pub version
|
| -h, --help Print usage information for this command.
|
|
|
| Run "pub help" to see global options.
|
| - ''',
|
| - exitCode: exit_codes.USAGE);
|
| + ''', exitCode: exit_codes.USAGE);
|
| });
|
| });
|
| -
|
| group('version', () {
|
| integration('displays the current version', () {
|
| schedulePub(args: ['version'], output: VERSION_STRING);
|
|
|