Index: utils/tests/pub/pub_install_hosted_test.dart |
diff --git a/utils/tests/pub/pub_install_hosted_test.dart b/utils/tests/pub/pub_install_hosted_test.dart |
index af7d08c13aea0086f6d8da0f02d0c052e781326a..77ee457a177290019cc85537611b772f18ac6e52 100644 |
--- a/utils/tests/pub/pub_install_hosted_test.dart |
+++ b/utils/tests/pub/pub_install_hosted_test.dart |
@@ -24,6 +24,39 @@ main() { |
run(); |
}); |
+ 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: ['install'], |
+ error: const RegExp('Could not resolve URL "http://pub.invalid".')); |
+ |
+ run(); |
+ }); |
+ |
+ test('fails gracefully if the package does not exist', () { |
+ servePackages([]); |
+ |
+ appDir([dependency("foo", "1.2.3")]).scheduleCreate(); |
+ |
+ schedulePub(args: ['install'], |
+ error: const RegExp('Could not find package "foo" on ' |
+ 'http://localhost:')); |
+ |
+ run(); |
+ }); |
+ |
test('checks out packages transitively from a pub server', () { |
servePackages([ |
package("foo", "1.2.3", [dependency("bar", "2.0.4")]), |