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

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

Issue 12211097: Added support for 'description' in pubspec.yaml. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/pubspec.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pubspec_test.dart
diff --git a/utils/tests/pub/pubspec_test.dart b/utils/tests/pub/pubspec_test.dart
index cb0402da9b276ed01ed3fd40154e3c0dbcbacb26..f2d0b6100b168dc323eb9f24d727c67d5c8f7dcf 100644
--- a/utils/tests/pub/pubspec_test.dart
+++ b/utils/tests/pub/pubspec_test.dart
@@ -22,6 +22,7 @@ class MockSource extends Source {
}
main() {
+ initConfig();
group('Pubspec', () {
group('parse()', () {
var sources = new SourceRegistry();
@@ -76,12 +77,27 @@ dependencies:
new Pubspec.parse('homepage: http://ok.com', sources);
new Pubspec.parse('homepage: https://also-ok.com', sources);
- expectFormatError('ftp://badscheme.com');
- expectFormatError('javascript:alert("!!!")');
- expectFormatError('data:image/png;base64,somedata');
+ expectFormatError('homepage: ftp://badscheme.com');
+ expectFormatError('homepage: javascript:alert("!!!")');
+ expectFormatError('homepage: data:image/png;base64,somedata');
expectFormatError('homepage: no-scheme.com');
});
+ test("throws if 'documentation' is not a string", () {
+ expectFormatError('documentation:');
+ expectFormatError('documentation: [not, a, string]');
+ });
+
+ test("throws if 'documentation' doesn't have an HTTP scheme", () {
+ new Pubspec.parse('documentation: http://ok.com', sources);
+ new Pubspec.parse('documentation: https://also-ok.com', sources);
+
+ expectFormatError('documentation: ftp://badscheme.com');
+ expectFormatError('documentation: javascript:alert("!!!")');
+ expectFormatError('documentation: data:image/png;base64,somedata');
+ expectFormatError('documentation: no-scheme.com');
+ });
+
test("throws if 'authors' is not a string or a list of strings", () {
new Pubspec.parse('authors: ok fine', sources);
new Pubspec.parse('authors: [also, ok, fine]', sources);
« no previous file with comments | « utils/pub/pubspec.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698