| 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 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
| 10 | 10 |
| 11 import 'descriptor.dart' as d; | 11 import 'descriptor.dart' as d; |
| 12 import 'test_pub.dart'; | 12 import 'test_pub.dart'; |
| 13 | 13 |
| 14 final USAGE_STRING = """ | 14 final USAGE_STRING = """ |
| 15 Pub is a package manager for Dart. | 15 Pub is a package manager for Dart. |
| 16 | 16 |
| 17 Usage: pub command [arguments] | 17 Usage: pub command [arguments] |
| 18 | 18 |
| 19 Global options: | 19 Global options: |
| 20 -h, --help Print this usage information. | 20 -h, --help Print this usage information. |
| 21 --version Print pub version. | 21 --version Print pub version. |
| 22 --[no-]trace Print debugging information when an error occurs. | 22 --[no-]trace Print debugging information when an error occurs. |
| 23 --verbosity Control output verbosity. | 23 --verbosity Control output verbosity. |
| 24 | 24 |
| 25 [all] Show all output including internal tracing messages. | 25 [all] Show all output including internal tracing messages. |
| 26 [io] Also show IO operations. | 26 [io] Also show IO operations. |
| 27 [normal] Show errors, warnings, and user messages. | 27 [normal] Show errors, warnings, and user messages. |
| 28 [solver] Show steps during version resolution. | 28 [solver] Show steps during version resolution. |
| 29 | 29 |
| 30 -v, --verbose Shortcut for "--verbosity=all" | 30 -v, --verbose Shortcut for "--verbosity=all". |
| 31 | 31 |
| 32 Available commands: | 32 Available commands: |
| 33 cache Inspect the system cache. | 33 cache Inspect the system cache. |
| 34 help Display help information for Pub. | 34 help Display help information for Pub. |
| 35 install Install the current package's dependencies. | 35 install Install the current package's dependencies. |
| 36 publish Publish the current package to pub.dartlang.org. | 36 publish Publish the current package to pub.dartlang.org. |
| 37 update Update the current package's dependencies to the latest version
s. | 37 update Update the current package's dependencies to the latest version
s. |
| 38 uploader Manage uploaders for a package on pub.dartlang.org. | 38 uploader Manage uploaders for a package on pub.dartlang.org. |
| 39 version Print pub version. | 39 version Print pub version. |
| 40 | 40 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 exitCode: 64); | 93 exitCode: 64); |
| 94 }); | 94 }); |
| 95 | 95 |
| 96 group('help', () { | 96 group('help', () { |
| 97 integration('shows help for a command', () { | 97 integration('shows help for a command', () { |
| 98 schedulePub(args: ['help', 'install'], | 98 schedulePub(args: ['help', 'install'], |
| 99 output: ''' | 99 output: ''' |
| 100 Install the current package's dependencies. | 100 Install the current package's dependencies. |
| 101 | 101 |
| 102 Usage: pub install | 102 Usage: pub install |
| 103 --[no-]offline Use cached packages instead of accessing the netwo
rk. |
| 103 '''); | 104 '''); |
| 104 }); | 105 }); |
| 105 | 106 |
| 106 integration('shows help for a command', () { | 107 integration('shows help for a command', () { |
| 107 schedulePub(args: ['help', 'publish'], | 108 schedulePub(args: ['help', 'publish'], |
| 108 output: ''' | 109 output: ''' |
| 109 Publish the current package to pub.dartlang.org. | 110 Publish the current package to pub.dartlang.org. |
| 110 | 111 |
| 111 Usage: pub publish [options] | 112 Usage: pub publish [options] |
| 112 -n, --dry-run Validate but do not publish the package
| 113 -n, --dry-run Validate but do not publish the package. |
| 113 -f, --force Publish without confirmation if there are no errors | 114 -f, --force Publish without confirmation if there are no errors
. |
| 114 --server The package server to which to upload this package | 115 --server The package server to which to upload this package. |
| 115 (defaults to "https://pub.dartlang.org") | 116 (defaults to "https://pub.dartlang.org") |
| 116 '''); | 117 '''); |
| 117 }); | 118 }); |
| 118 | 119 |
| 119 integration('an unknown help command displays an error message', () { | 120 integration('an unknown help command displays an error message', () { |
| 120 schedulePub(args: ['help', 'quylthulg'], | 121 schedulePub(args: ['help', 'quylthulg'], |
| 121 error: ''' | 122 error: ''' |
| 122 Could not find a command named "quylthulg". | 123 Could not find a command named "quylthulg". |
| 123 Run "pub help" to see available commands. | 124 Run "pub help" to see available commands. |
| 124 ''', | 125 ''', |
| (...skipping 19 matching lines...) Expand all Loading... |
| 144 // The "version" file generated on developer builds is a little funky and | 145 // The "version" file generated on developer builds is a little funky and |
| 145 // we need to make sure we don't choke on it. | 146 // we need to make sure we don't choke on it. |
| 146 d.dir(sdkPath, [ | 147 d.dir(sdkPath, [ |
| 147 d.file('version', '0.1.2.0_r16279_bobross'), | 148 d.file('version', '0.1.2.0_r16279_bobross'), |
| 148 ]).create(); | 149 ]).create(); |
| 149 | 150 |
| 150 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); | 151 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); |
| 151 }); | 152 }); |
| 152 }); | 153 }); |
| 153 } | 154 } |
| OLD | NEW |