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:pub/src/exit_codes.dart' as exit_codes; | 7 import 'package:pub/src/exit_codes.dart' as exit_codes; |
8 | 8 |
9 import '../descriptor.dart' as d; | 9 import '../descriptor.dart' as d; |
10 import '../test_pub.dart'; | 10 import '../test_pub.dart'; |
11 | 11 |
12 main() { | 12 main() { |
13 initConfig(); | |
14 | |
15 forBothPubGetAndUpgrade((command) { | 13 forBothPubGetAndUpgrade((command) { |
16 integration('fails gracefully if the url does not resolve', () { | 14 integration('fails gracefully if the url does not resolve', () { |
17 d.dir(appPath, [ | 15 d.dir(appPath, [ |
18 d.appPubspec({ | 16 d.appPubspec({ |
19 "foo": { | 17 "foo": { |
20 "hosted": { | 18 "hosted": { |
21 "name": "foo", | 19 "name": "foo", |
22 "url": "http://pub.invalid" | 20 "url": "http://pub.invalid" |
23 } | 21 } |
24 } | 22 } |
25 }) | 23 }) |
26 ]).create(); | 24 ]).create(); |
27 | 25 |
28 pubCommand(command, error: 'Could not resolve URL "http://pub.invalid".', | 26 pubCommand(command, error: 'Could not resolve URL "http://pub.invalid".', |
29 exitCode: exit_codes.UNAVAILABLE); | 27 exitCode: exit_codes.UNAVAILABLE); |
30 }); | 28 }); |
31 }); | 29 }); |
32 } | 30 } |
OLD | NEW |