OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 10 |
11 import 'test_pub.dart'; | 11 import 'test_pub.dart'; |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 file(join(appPath, "lib", "test_pkg.dart"), '').scheduleDelete(); | 309 file(join(appPath, "lib", "test_pkg.dart"), '').scheduleDelete(); |
310 dir(appPath, [ | 310 dir(appPath, [ |
311 dir("lib", [ | 311 dir("lib", [ |
312 dir("src", [file("test_pkg.dart", "int i = 0;")]) | 312 dir("src", [file("test_pkg.dart", "int i = 0;")]) |
313 ]) | 313 ]) |
314 ]).scheduleCreate(); | 314 ]).scheduleCreate(); |
315 expectValidationError(lib); | 315 expectValidationError(lib); |
316 run(); | 316 run(); |
317 }); | 317 }); |
318 | 318 |
319 test('has a dependency with a path source', () { | |
320 dir(appPath, [ | |
321 libPubspec("test_pkg", "1.0.0", [ | |
322 {'path': '/foo/bar'} | |
323 ]) | |
324 ]).scheduleCreate(); | |
325 expectValidationError(dependency); | |
Bob Nystrom
2013/01/17 19:15:10
Great test.
| |
326 run(); | |
327 }); | |
328 | |
319 group('has a dependency with a non-hosted source', () { | 329 group('has a dependency with a non-hosted source', () { |
320 group('where a hosted version of that dependency exists', () { | 330 group('where a hosted version of that dependency exists', () { |
321 test("and should suggest the hosted package's primary version", () { | 331 test("and should suggest the hosted package's primary version", () { |
322 useMockClient(new MockClient((request) { | 332 useMockClient(new MockClient((request) { |
323 expect(request.method, equals("GET")); | 333 expect(request.method, equals("GET")); |
324 expect(request.url.path, equals("/packages/foo.json")); | 334 expect(request.url.path, equals("/packages/foo.json")); |
325 | 335 |
326 return new Future.immediate(new http.Response(json.stringify({ | 336 return new Future.immediate(new http.Response(json.stringify({ |
327 "name": "foo", | 337 "name": "foo", |
328 "uploaders": ["nweiz@google.com"], | 338 "uploaders": ["nweiz@google.com"], |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 for (var name in names) { | 574 for (var name in names) { |
565 test('"$name"', () { | 575 test('"$name"', () { |
566 dir(appPath, [dir(name)]).scheduleCreate(); | 576 dir(appPath, [dir(name)]).scheduleCreate(); |
567 expectValidationWarning(directory); | 577 expectValidationWarning(directory); |
568 run(); | 578 run(); |
569 }); | 579 }); |
570 } | 580 } |
571 }); | 581 }); |
572 }); | 582 }); |
573 } | 583 } |
OLD | NEW |