| 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);
|
|
|