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_semver/pub_semver.dart'; |
9 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
10 | 11 |
11 import '../lib/src/package.dart'; | 12 import '../lib/src/package.dart'; |
12 import '../lib/src/pubspec.dart'; | 13 import '../lib/src/pubspec.dart'; |
13 import '../lib/src/source.dart'; | 14 import '../lib/src/source.dart'; |
14 import '../lib/src/source_registry.dart'; | 15 import '../lib/src/source_registry.dart'; |
15 import '../lib/src/version.dart'; | |
16 import 'test_pub.dart'; | 16 import 'test_pub.dart'; |
17 | 17 |
18 class MockSource extends Source { | 18 class MockSource extends Source { |
19 final String name = "mock"; | 19 final String name = "mock"; |
20 | 20 |
21 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( | 21 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( |
22 "Cannot describe mock packages."); | 22 "Cannot describe mock packages."); |
23 | 23 |
24 Future get(PackageId id, String symlink) => throw new UnsupportedError( | 24 Future get(PackageId id, String symlink) => throw new UnsupportedError( |
25 "Cannot get a mock package."); | 25 "Cannot get a mock package."); |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 test("uses the key if the value is null", () { | 492 test("uses the key if the value is null", () { |
493 var pubspec = new Pubspec.parse(''' | 493 var pubspec = new Pubspec.parse(''' |
494 executables: | 494 executables: |
495 command: | 495 command: |
496 ''', sources); | 496 ''', sources); |
497 expect(pubspec.executables['command'], equals('command')); | 497 expect(pubspec.executables['command'], equals('command')); |
498 }); | 498 }); |
499 }); | 499 }); |
500 }); | 500 }); |
501 } | 501 } |
OLD | NEW |