| Index: utils/tests/pub/update/hosted/fail_gracefully_on_url_resolve_test.dart
|
| diff --git a/utils/tests/pub/update/hosted/fail_gracefully_on_url_resolve_test.dart b/utils/tests/pub/update/hosted/fail_gracefully_on_url_resolve_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..bb7ca636e5bdc18a25eadd1a829431f493699832
|
| --- /dev/null
|
| +++ b/utils/tests/pub/update/hosted/fail_gracefully_on_url_resolve_test.dart
|
| @@ -0,0 +1,34 @@
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +#library('pub_tests');
|
| +
|
| +#import('dart:io');
|
| +
|
| +#import('../../test_pub.dart');
|
| +#import('../../../../../pkg/unittest/unittest.dart');
|
| +
|
| +main() {
|
| + test('fails gracefully if the url does not resolve', () {
|
| + dir(appPath, [
|
| + pubspec({
|
| + "name": "myapp",
|
| + "dependencies": {
|
| + "foo": {
|
| + "hosted": {
|
| + "name": "foo",
|
| + "url": "http://pub.invalid"
|
| + }
|
| + }
|
| + }
|
| + })
|
| + ]).scheduleCreate();
|
| +
|
| + schedulePub(args: ['update'],
|
| + error: const RegExp('Could not resolve URL "http://pub.invalid".'),
|
| + exitCode: 1);
|
| +
|
| + run();
|
| + });
|
| +}
|
|
|