OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library validator_test; | 5 library validator_test; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:json'; | 8 import 'dart:json'; |
9 | 9 |
10 import 'test_pub.dart'; | 10 import 'test_pub.dart'; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 group('should consider a package invalid if it', () { | 49 group('should consider a package invalid if it', () { |
50 test('is missing the "homepage" field', () { | 50 test('is missing the "homepage" field', () { |
51 var package = package("test_pkg", "1.0.0"); | 51 var package = package("test_pkg", "1.0.0"); |
52 package.remove("homepage"); | 52 package.remove("homepage"); |
53 dir(appPath, [pubspec(package)]).scheduleCreate(); | 53 dir(appPath, [pubspec(package)]).scheduleCreate(); |
54 | 54 |
55 expectValidationError(pubspecField); | 55 expectValidationError(pubspecField); |
56 run(); | 56 run(); |
57 }); | 57 }); |
58 | 58 |
| 59 test('is missing the "description" field', () { |
| 60 var package = package("test_pkg", "1.0.0"); |
| 61 package.remove("description"); |
| 62 dir(appPath, [pubspec(package)]).scheduleCreate(); |
| 63 |
| 64 expectValidationError(pubspecField); |
| 65 run(); |
| 66 }); |
| 67 |
59 test('is missing the "author" field', () { | 68 test('is missing the "author" field', () { |
60 var package = package("test_pkg", "1.0.0"); | 69 var package = package("test_pkg", "1.0.0"); |
61 package.remove("author"); | 70 package.remove("author"); |
62 dir(appPath, [pubspec(package)]).scheduleCreate(); | 71 dir(appPath, [pubspec(package)]).scheduleCreate(); |
63 | 72 |
64 expectValidationError(pubspecField); | 73 expectValidationError(pubspecField); |
65 run(); | 74 run(); |
66 }); | 75 }); |
67 | 76 |
68 test('has a single author without an email', () { | 77 test('has a single author without an email', () { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 "<nweiz@google.com>", | 114 "<nweiz@google.com>", |
106 "John Messerly <jmesserly@google.com>" | 115 "John Messerly <jmesserly@google.com>" |
107 ]; | 116 ]; |
108 dir(appPath, [pubspec(package)]).scheduleCreate(); | 117 dir(appPath, [pubspec(package)]).scheduleCreate(); |
109 | 118 |
110 expectValidationWarning(pubspecField); | 119 expectValidationWarning(pubspecField); |
111 run(); | 120 run(); |
112 }); | 121 }); |
113 }); | 122 }); |
114 } | 123 } |
OLD | NEW |