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 'test_pub.dart'; | 9 import 'test_pub.dart'; |
10 import '../../../pkg/unittest/lib/unittest.dart'; | 10 import '../../../pkg/unittest/lib/unittest.dart'; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 integration('running pub with just --help displays usage', () { | 49 integration('running pub with just --help displays usage', () { |
50 schedulePub(args: ['--help'], output: USAGE_STRING); | 50 schedulePub(args: ['--help'], output: USAGE_STRING); |
51 }); | 51 }); |
52 | 52 |
53 integration('running pub with just -h displays usage', () { | 53 integration('running pub with just -h displays usage', () { |
54 schedulePub(args: ['-h'], output: USAGE_STRING); | 54 schedulePub(args: ['-h'], output: USAGE_STRING); |
55 }); | 55 }); |
56 | 56 |
57 integration('running pub with just --version displays version', () { | 57 integration('running pub with just --version displays version', () { |
58 dir(sdkPath, [ | |
59 file('version', '0.1.2.3'), | |
60 ]).scheduleCreate(); | |
61 | |
62 schedulePub(args: ['--version'], output: VERSION_STRING); | 58 schedulePub(args: ['--version'], output: VERSION_STRING); |
63 }); | 59 }); |
64 | 60 |
65 integration('an unknown command displays an error message', () { | 61 integration('an unknown command displays an error message', () { |
66 schedulePub(args: ['quylthulg'], | 62 schedulePub(args: ['quylthulg'], |
67 error: ''' | 63 error: ''' |
68 Could not find a command named "quylthulg". | 64 Could not find a command named "quylthulg". |
69 Run "pub help" to see available commands. | 65 Run "pub help" to see available commands. |
70 ''', | 66 ''', |
71 exitCode: 64); | 67 exitCode: 64); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 Could not find a command named "quylthulg". | 114 Could not find a command named "quylthulg". |
119 Run "pub help" to see available commands. | 115 Run "pub help" to see available commands. |
120 ''', | 116 ''', |
121 exitCode: 64); | 117 exitCode: 64); |
122 }); | 118 }); |
123 | 119 |
124 }); | 120 }); |
125 | 121 |
126 group('version', () { | 122 group('version', () { |
127 integration('displays the current version', () { | 123 integration('displays the current version', () { |
128 dir(sdkPath, [ | |
129 file('version', '0.1.2.3'), | |
130 ]).scheduleCreate(); | |
131 | |
132 schedulePub(args: ['version'], output: VERSION_STRING); | 124 schedulePub(args: ['version'], output: VERSION_STRING); |
133 }); | 125 }); |
134 | 126 |
135 integration('parses a release-style version', () { | 127 integration('parses a release-style version', () { |
136 dir(sdkPath, [ | 128 dir(sdkPath, [ |
137 file('version', '0.1.2.0_r17645'), | 129 file('version', '0.1.2.0_r17645'), |
138 ]).scheduleCreate(); | 130 ]).scheduleCreate(); |
139 | 131 |
140 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r17645\n"); | 132 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r17645\n"); |
141 }); | 133 }); |
142 | 134 |
143 integration('parses a dev-only style version', () { | 135 integration('parses a dev-only style version', () { |
144 // The "version" file generated on developer builds is a little funky and | 136 // The "version" file generated on developer builds is a little funky and |
145 // we need to make sure we don't choke on it. | 137 // we need to make sure we don't choke on it. |
146 dir(sdkPath, [ | 138 dir(sdkPath, [ |
147 file('version', '0.1.2.0_r16279_bobross'), | 139 file('version', '0.1.2.0_r16279_bobross'), |
148 ]).scheduleCreate(); | 140 ]).scheduleCreate(); |
149 | 141 |
150 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); | 142 schedulePub(args: ['version'], output: "Pub 0.1.2+0.r16279.bobross\n"); |
151 }); | 143 }); |
152 }); | 144 }); |
153 } | 145 } |
OLD | NEW |