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 pubspec_test; | 5 library pubspec_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
| 9 import 'package:pub/src/package.dart'; |
| 10 import 'package:pub/src/pubspec.dart'; |
| 11 import 'package:pub/src/source.dart'; |
| 12 import 'package:pub/src/source/path.dart'; |
| 13 import 'package:pub/src/source_registry.dart'; |
9 import 'package:pub_semver/pub_semver.dart'; | 14 import 'package:pub_semver/pub_semver.dart'; |
10 import 'package:unittest/unittest.dart'; | 15 import 'package:unittest/unittest.dart'; |
11 | 16 |
12 import '../lib/src/package.dart'; | |
13 import '../lib/src/pubspec.dart'; | |
14 import '../lib/src/source.dart'; | |
15 import '../lib/src/source/path.dart'; | |
16 import '../lib/src/source_registry.dart'; | |
17 import 'test_pub.dart'; | 17 import 'test_pub.dart'; |
18 | 18 |
19 class MockSource extends Source { | 19 class MockSource extends Source { |
20 final String name = "mock"; | 20 final String name = "mock"; |
21 | 21 |
22 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( | 22 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( |
23 "Cannot describe mock packages."); | 23 "Cannot describe mock packages."); |
24 | 24 |
25 Future get(PackageId id, String symlink) => throw new UnsupportedError( | 25 Future get(PackageId id, String symlink) => throw new UnsupportedError( |
26 "Cannot get a mock package."); | 26 "Cannot get a mock package."); |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 test("uses the key if the value is null", () { | 523 test("uses the key if the value is null", () { |
524 var pubspec = new Pubspec.parse(''' | 524 var pubspec = new Pubspec.parse(''' |
525 executables: | 525 executables: |
526 command: | 526 command: |
527 ''', sources); | 527 ''', sources); |
528 expect(pubspec.executables['command'], equals('command')); | 528 expect(pubspec.executables['command'], equals('command')); |
529 }); | 529 }); |
530 }); | 530 }); |
531 }); | 531 }); |
532 } | 532 } |
OLD | NEW |