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

Side by Side Diff: utils/tests/pub/validator_test.dart

Issue 12262056: Clean up some warnings and deprecated calls. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | utils/tests/pub/version_solver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:json' as json; 9 import 'dart:json' as json;
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 expectNoValidationError(license); 126 expectNoValidationError(license);
127 }); 127 });
128 128
129 integration('has a suffixed LICENSE file', () { 129 integration('has a suffixed LICENSE file', () {
130 file(join(appPath, 'LICENSE'), '').scheduleDelete(); 130 file(join(appPath, 'LICENSE'), '').scheduleDelete();
131 file(join(appPath, 'LICENSE.md'), '').scheduleCreate(); 131 file(join(appPath, 'LICENSE.md'), '').scheduleCreate();
132 expectNoValidationError(license); 132 expectNoValidationError(license);
133 }); 133 });
134 134
135 integration('has "authors" instead of "author"', () { 135 integration('has "authors" instead of "author"', () {
136 var package = package("test_pkg", "1.0.0"); 136 var pkg = package("test_pkg", "1.0.0");
137 package["authors"] = [package.remove("author")]; 137 pkg["authors"] = [pkg.remove("author")];
138 dir(appPath, [pubspec(package)]).scheduleCreate(); 138 dir(appPath, [pubspec(pkg)]).scheduleCreate();
139 expectNoValidationError(pubspecField); 139 expectNoValidationError(pubspecField);
140 }); 140 });
141 141
142 integration('has a badly-named library in lib/src', () { 142 integration('has a badly-named library in lib/src', () {
143 dir(appPath, [ 143 dir(appPath, [
144 libPubspec("test_pkg", "1.0.0"), 144 libPubspec("test_pkg", "1.0.0"),
145 dir("lib", [ 145 dir("lib", [
146 file("test_pkg.dart", "int i = 1;"), 146 file("test_pkg.dart", "int i = 1;"),
147 dir("src", [file("8ball.dart", "int j = 2;")]) 147 dir("src", [file("8ball.dart", "int j = 2;")])
148 ]) 148 ])
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 binaryFile("README.invalid", [192]) 199 binaryFile("README.invalid", [192])
200 ]).scheduleCreate(); 200 ]).scheduleCreate();
201 expectNoValidationError(utf8Readme); 201 expectNoValidationError(utf8Readme);
202 }); 202 });
203 }); 203 });
204 204
205 group('should consider a package invalid if it', () { 205 group('should consider a package invalid if it', () {
206 setUp(scheduleNormalPackage); 206 setUp(scheduleNormalPackage);
207 207
208 integration('is missing the "homepage" field', () { 208 integration('is missing the "homepage" field', () {
209 var package = package("test_pkg", "1.0.0"); 209 var pkg = package("test_pkg", "1.0.0");
210 package.remove("homepage"); 210 pkg.remove("homepage");
211 dir(appPath, [pubspec(package)]).scheduleCreate(); 211 dir(appPath, [pubspec(pkg)]).scheduleCreate();
212 212
213 expectValidationError(pubspecField); 213 expectValidationError(pubspecField);
214 }); 214 });
215 215
216 integration('is missing the "description" field', () { 216 integration('is missing the "description" field', () {
217 var package = package("test_pkg", "1.0.0"); 217 var pkg = package("test_pkg", "1.0.0");
218 package.remove("description"); 218 pkg.remove("description");
219 dir(appPath, [pubspec(package)]).scheduleCreate(); 219 dir(appPath, [pubspec(pkg)]).scheduleCreate();
220 220
221 expectValidationError(pubspecField); 221 expectValidationError(pubspecField);
222 }); 222 });
223 223
224 integration('is missing the "author" field', () { 224 integration('is missing the "author" field', () {
225 var package = package("test_pkg", "1.0.0"); 225 var pkg = package("test_pkg", "1.0.0");
226 package.remove("author"); 226 pkg.remove("author");
227 dir(appPath, [pubspec(package)]).scheduleCreate(); 227 dir(appPath, [pubspec(pkg)]).scheduleCreate();
228 228
229 expectValidationError(pubspecField); 229 expectValidationError(pubspecField);
230 }); 230 });
231 231
232 integration('has a single author without an email', () { 232 integration('has a single author without an email', () {
233 var package = package("test_pkg", "1.0.0"); 233 var pkg = package("test_pkg", "1.0.0");
234 package["author"] = "Nathan Weizenbaum"; 234 pkg["author"] = "Nathan Weizenbaum";
235 dir(appPath, [pubspec(package)]).scheduleCreate(); 235 dir(appPath, [pubspec(pkg)]).scheduleCreate();
236 236
237 expectValidationWarning(pubspecField); 237 expectValidationWarning(pubspecField);
238 }); 238 });
239 239
240 integration('has one of several authors without an email', () { 240 integration('has one of several authors without an email', () {
241 var package = package("test_pkg", "1.0.0"); 241 var pkg = package("test_pkg", "1.0.0");
242 package.remove("author"); 242 pkg.remove("author");
243 package["authors"] = [ 243 pkg["authors"] = [
244 "Bob Nystrom <rnystrom@google.com>", 244 "Bob Nystrom <rnystrom@google.com>",
245 "Nathan Weizenbaum", 245 "Nathan Weizenbaum",
246 "John Messerly <jmesserly@google.com>" 246 "John Messerly <jmesserly@google.com>"
247 ]; 247 ];
248 dir(appPath, [pubspec(package)]).scheduleCreate(); 248 dir(appPath, [pubspec(pkg)]).scheduleCreate();
249 249
250 expectValidationWarning(pubspecField); 250 expectValidationWarning(pubspecField);
251 }); 251 });
252 252
253 integration('has a single author without a name', () { 253 integration('has a single author without a name', () {
254 var package = package("test_pkg", "1.0.0"); 254 var pkg = package("test_pkg", "1.0.0");
255 package["author"] = "<nweiz@google.com>"; 255 pkg["author"] = "<nweiz@google.com>";
256 dir(appPath, [pubspec(package)]).scheduleCreate(); 256 dir(appPath, [pubspec(pkg)]).scheduleCreate();
257 257
258 expectValidationWarning(pubspecField); 258 expectValidationWarning(pubspecField);
259 }); 259 });
260 260
261 integration('has one of several authors without a name', () { 261 integration('has one of several authors without a name', () {
262 var package = package("test_pkg", "1.0.0"); 262 var pkg = package("test_pkg", "1.0.0");
263 package.remove("author"); 263 pkg.remove("author");
264 package["authors"] = [ 264 pkg["authors"] = [
265 "Bob Nystrom <rnystrom@google.com>", 265 "Bob Nystrom <rnystrom@google.com>",
266 "<nweiz@google.com>", 266 "<nweiz@google.com>",
267 "John Messerly <jmesserly@google.com>" 267 "John Messerly <jmesserly@google.com>"
268 ]; 268 ];
269 dir(appPath, [pubspec(package)]).scheduleCreate(); 269 dir(appPath, [pubspec(pkg)]).scheduleCreate();
270 270
271 expectValidationWarning(pubspecField); 271 expectValidationWarning(pubspecField);
272 }); 272 });
273 273
274 integration('has no LICENSE file', () { 274 integration('has no LICENSE file', () {
275 file(join(appPath, 'LICENSE'), '').scheduleDelete(); 275 file(join(appPath, 'LICENSE'), '').scheduleDelete();
276 expectValidationError(license); 276 expectValidationError(license);
277 }); 277 });
278 278
279 integration('has an empty package name', () { 279 integration('has an empty package name', () {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 }); 575 });
576 576
577 test('has a README with invalid utf-8', () { 577 test('has a README with invalid utf-8', () {
578 dir(appPath, [ 578 dir(appPath, [
579 binaryFile("README", [192]) 579 binaryFile("README", [192])
580 ]).scheduleCreate(); 580 ]).scheduleCreate();
581 expectValidationWarning(utf8Readme); 581 expectValidationWarning(utf8Readme);
582 }); 582 });
583 }); 583 });
584 } 584 }
OLDNEW
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | utils/tests/pub/version_solver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698