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

Unified Diff: sdk/lib/_internal/pub/test/pubspec_test.dart

Issue 417043005: Add publishTo to pubspec and use it in pub lish. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
Index: sdk/lib/_internal/pub/test/pubspec_test.dart
diff --git a/sdk/lib/_internal/pub/test/pubspec_test.dart b/sdk/lib/_internal/pub/test/pubspec_test.dart
index 1d38c6c5162db1d345fd465d81004c8a9edbaea0..41e6d7c935bedcbe70086aa75b24ecdbb6a2206b 100644
--- a/sdk/lib/_internal/pub/test/pubspec_test.dart
+++ b/sdk/lib/_internal/pub/test/pubspec_test.dart
@@ -413,5 +413,36 @@ environment:
(pubspec) => pubspec.environment);
});
});
+
+ group("publishTo", () {
+ test("defaults to null if omitted", () {
+ var pubspec = new Pubspec.parse('', sources);
+ expect(pubspec.publishTo, isNull);
+ });
+
+ test("throws if not a string", () {
+ expectPubspecException('publishTo: 123',
+ (pubspec) => pubspec.publishTo);
+ });
+
+ test("allows a URL", () {
+ var pubspec = new Pubspec.parse('''
+publishTo: http://example.com
+''', sources);
+ expect(pubspec.publishTo, equals("http://example.com"));
+ });
+
+ test("allows none", () {
+ var pubspec = new Pubspec.parse('''
+publishTo: none
+''', sources);
+ expect(pubspec.publishTo, equals("none"));
+ });
+
+ test("throws on other strings", () {
+ expectPubspecException('publishTo: http://bad.url:not-port',
+ (pubspec) => pubspec.publishTo);
+ });
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698