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

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: Revise. Created 6 years, 4 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 | « sdk/lib/_internal/pub/test/lish/uses_publish_to_url_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ });
+ });
});
}
« no previous file with comments | « sdk/lib/_internal/pub/test/lish/uses_publish_to_url_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698