OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_uploader_test; | 5 library pub_uploader_test; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:json' as json; | 8 import 'dart:json' as json; |
9 | 9 |
10 import 'package:scheduled_test/scheduled_process.dart'; | 10 import 'package:scheduled_test/scheduled_process.dart'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 '''; | 28 '''; |
29 | 29 |
30 ScheduledProcess startPubUploader(ScheduledServer server, List<String> args) { | 30 ScheduledProcess startPubUploader(ScheduledServer server, List<String> args) { |
31 var tokenEndpoint = server.url.then((url) => | 31 var tokenEndpoint = server.url.then((url) => |
32 url.resolve('/token').toString()); | 32 url.resolve('/token').toString()); |
33 args = flatten(['uploader', '--server', tokenEndpoint, args]); | 33 args = flatten(['uploader', '--server', tokenEndpoint, args]); |
34 return startPub(args: args, tokenEndpoint: tokenEndpoint); | 34 return startPub(args: args, tokenEndpoint: tokenEndpoint); |
35 } | 35 } |
36 | 36 |
37 main() { | 37 main() { |
| 38 initConfig(); |
38 group('displays usage', () { | 39 group('displays usage', () { |
39 integration('when run with no arguments', () { | 40 integration('when run with no arguments', () { |
40 schedulePub(args: ['uploader'], | 41 schedulePub(args: ['uploader'], |
41 output: USAGE_STRING, exitCode: 64); | 42 output: USAGE_STRING, exitCode: 64); |
42 }); | 43 }); |
43 | 44 |
44 integration('when run with only a command', () { | 45 integration('when run with only a command', () { |
45 schedulePub(args: ['uploader', 'add'], | 46 schedulePub(args: ['uploader', 'add'], |
46 output: USAGE_STRING, exitCode: 64); | 47 output: USAGE_STRING, exitCode: 64); |
47 }); | 48 }); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 server.handle('DELETE', '/packages/pkg/uploaders/email.json', (request) { | 175 server.handle('DELETE', '/packages/pkg/uploaders/email.json', (request) { |
175 request.response.write("{not json"); | 176 request.response.write("{not json"); |
176 request.response.close(); | 177 request.response.close(); |
177 }); | 178 }); |
178 | 179 |
179 expect(pub.nextErrLine(), completion(equals('Invalid server response:'))); | 180 expect(pub.nextErrLine(), completion(equals('Invalid server response:'))); |
180 expect(pub.nextErrLine(), completion(equals('{not json'))); | 181 expect(pub.nextErrLine(), completion(equals('{not json'))); |
181 pub.shouldExit(1); | 182 pub.shouldExit(1); |
182 }); | 183 }); |
183 } | 184 } |
OLD | NEW |