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 lock_file_test; | 5 library lock_file_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; |
11 | 11 |
12 import '../lib/src/lock_file.dart'; | 12 import '../lib/src/lock_file.dart'; |
13 import '../lib/src/package.dart'; | 13 import '../lib/src/package.dart'; |
14 import '../lib/src/pubspec.dart'; | 14 import '../lib/src/pubspec.dart'; |
15 import '../lib/src/source.dart'; | 15 import '../lib/src/source.dart'; |
16 import '../lib/src/source_registry.dart'; | 16 import '../lib/src/source_registry.dart'; |
17 import '../lib/src/version.dart'; | 17 import '../lib/src/version.dart'; |
18 import 'test_pub.dart'; | 18 import 'test_pub.dart'; |
19 | 19 |
20 class MockSource extends Source { | 20 class MockSource extends Source { |
21 final String name = 'mock'; | 21 final String name = 'mock'; |
22 | 22 |
23 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( | 23 Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError( |
24 "Cannot describe mock packages."); | 24 "Cannot describe mock packages."); |
25 | 25 |
26 Future<bool> get(PackageId id, String path) => throw new UnsupportedError( | 26 Future ensureLocal(PackageId id) => throw new UnsupportedError( |
27 "Cannot get a mock package."); | 27 "Cannot get a mock package."); |
28 | 28 |
| 29 Future get(PackageId id, String symlink) => throw new UnsupportedError( |
| 30 "Cannot get an mock."); |
| 31 |
29 Future<String> getDirectory(PackageId id) => throw new UnsupportedError( | 32 Future<String> getDirectory(PackageId id) => throw new UnsupportedError( |
30 "Cannot get the directory for mock packages."); | 33 "Cannot get the directory for mock packages."); |
31 | 34 |
32 dynamic parseDescription(String filePath, String description, | 35 dynamic parseDescription(String filePath, String description, |
33 {bool fromLockFile: false}) { | 36 {bool fromLockFile: false}) { |
34 if (!description.endsWith(' desc')) throw new FormatException(); | 37 if (!description.endsWith(' desc')) throw new FormatException(); |
35 return description; | 38 return description; |
36 } | 39 } |
37 | 40 |
38 bool descriptionsEqual(description1, description2) => | 41 bool descriptionsEqual(description1, description2) => |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 'version': '3.2.1', | 207 'version': '3.2.1', |
205 'source': 'mock', | 208 'source': 'mock', |
206 'description': 'bar desc' | 209 'description': 'bar desc' |
207 } | 210 } |
208 } | 211 } |
209 })); | 212 })); |
210 }); | 213 }); |
211 }); | 214 }); |
212 }); | 215 }); |
213 } | 216 } |
OLD | NEW |