| 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 'descriptor.dart' as d; | 9 import 'descriptor.dart' as d; |
| 10 import 'test_pub.dart'; | 10 import 'test_pub.dart'; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // TODO(rnystrom): When pub has command-specific options, a more precise | 107 // TODO(rnystrom): When pub has command-specific options, a more precise |
| 108 // error message would be good here. | 108 // error message would be good here. |
| 109 schedulePub(args: ['version', '--blorf'], | 109 schedulePub(args: ['version', '--blorf'], |
| 110 error: ''' | 110 error: ''' |
| 111 Could not find an option named "blorf". | 111 Could not find an option named "blorf". |
| 112 Run "pub help" to see available options. | 112 Run "pub help" to see available options. |
| 113 ''', | 113 ''', |
| 114 exitCode: 64); | 114 exitCode: 64); |
| 115 }); | 115 }); |
| 116 | 116 |
| 117 integration('an unexpected argument displays an error message', () { |
| 118 schedulePub(args: ['version', 'unexpected'], |
| 119 output: ''' |
| 120 Print pub version. |
| 121 |
| 122 Usage: pub version |
| 123 -h, --help Print usage information for this command. |
| 124 ''', |
| 125 error: ''' |
| 126 Command does not take any arguments. |
| 127 ''', |
| 128 exitCode: 64); |
| 129 }); |
| 130 |
| 117 group('help', () { | 131 group('help', () { |
| 118 integration('shows help for a command', () { | 132 integration('shows help for a command', () { |
| 119 schedulePub(args: ['help', 'get'], | 133 schedulePub(args: ['help', 'get'], |
| 120 output: ''' | 134 output: ''' |
| 121 Get the current package's dependencies. | 135 Get the current package's dependencies. |
| 122 | 136 |
| 123 Usage: pub get | 137 Usage: pub get |
| 124 -h, --help Print usage information for this command. | 138 -h, --help Print usage information for this command. |
| 125 --[no-]offline Use cached packages instead of accessing the n
etwork. | 139 --[no-]offline Use cached packages instead of accessing the n
etwork. |
| 126 '''); | 140 '''); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // The "version" file generated on developer builds is a little funky and | 182 // The "version" file generated on developer builds is a little funky and |
| 169 // we need to make sure we don't choke on it. | 183 // we need to make sure we don't choke on it. |
| 170 d.dir(sdkPath, [ | 184 d.dir(sdkPath, [ |
| 171 d.file('version', '0.1.2.0_r16279_bobross'), | 185 d.file('version', '0.1.2.0_r16279_bobross'), |
| 172 ]).create(); | 186 ]).create(); |
| 173 | 187 |
| 174 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); | 188 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); |
| 175 }); | 189 }); |
| 176 }); | 190 }); |
| 177 } | 191 } |
| OLD | NEW |