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

Unified Diff: utils/tests/pub/pub_update_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/tests/pub/pub_install_hosted_test.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_update_hosted_test.dart
diff --git a/utils/tests/pub/pub_update_hosted_test.dart b/utils/tests/pub/pub_update_hosted_test.dart
index 20ddda854ecf25977fd8e6fe6ea6e8944a41129b..b5d1ea18f0c6689277d620a4f27d458f62ce74e0 100644
--- a/utils/tests/pub/pub_update_hosted_test.dart
+++ b/utils/tests/pub/pub_update_hosted_test.dart
@@ -10,6 +10,39 @@
#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".'));
+
+ run();
+ });
+
+ test('fails gracefully if the package does not exist', () {
+ servePackages([]);
+
+ appDir([dependency("foo", "1.2.3")]).scheduleCreate();
+
+ schedulePub(args: ['update'],
+ error: const RegExp('Could not find package "foo" on '
+ 'http://localhost:'));
+
+ run();
+ });
+
test("updates one locked pub server package's dependencies if it's "
"necessary", () {
servePackages([
« no previous file with comments | « utils/tests/pub/pub_install_hosted_test.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698