Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: utils/tests/pub/pub_install_hosted_test.dart

Issue 10917053: Show nicer errors on some server failures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unnecessary check. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/tests/pub/pub_update_hosted_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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")]),
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/tests/pub/pub_update_hosted_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698