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

Unified Diff: sdk/lib/_internal/pub/test/lock_file_test.dart

Issue 243683002: Refactor Source. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise all the things. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/system_cache.dart ('k') | sdk/lib/_internal/pub/test/pubspec_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/lock_file_test.dart
diff --git a/sdk/lib/_internal/pub/test/lock_file_test.dart b/sdk/lib/_internal/pub/test/lock_file_test.dart
index 29c9fcc569acf951d45eaadde30d53d577fc2019..f5cff29fe011ef9819d4f6b381f375cc2c4c1692 100644
--- a/sdk/lib/_internal/pub/test/lock_file_test.dart
+++ b/sdk/lib/_internal/pub/test/lock_file_test.dart
@@ -4,11 +4,14 @@
library lock_file_test;
+import 'dart:async';
+
import 'package:unittest/unittest.dart';
import 'package:yaml/yaml.dart';
import '../lib/src/lock_file.dart';
import '../lib/src/package.dart';
+import '../lib/src/pubspec.dart';
import '../lib/src/source.dart';
import '../lib/src/source_registry.dart';
import '../lib/src/version.dart';
@@ -16,7 +19,15 @@ import 'test_pub.dart';
class MockSource extends Source {
final String name = 'mock';
- final bool shouldCache = false;
+
+ Future<Pubspec> onDescribe(PackageId id) => throw new UnsupportedError(
+ "Cannot describe mock packages.");
+
+ Future<bool> get(PackageId id, String path) => throw new UnsupportedError(
+ "Cannot get a mock package.");
+
+ Future<String> getDirectory(PackageId id) => throw new UnsupportedError(
+ "Cannot get the directory for mock packages.");
dynamic parseDescription(String filePath, String description,
{bool fromLockFile: false}) {
@@ -24,6 +35,9 @@ class MockSource extends Source {
return description;
}
+ bool descriptionsEqual(description1, description2) =>
+ description1 == description2;
+
String packageName(String description) {
// Strip off ' desc'.
return description.substring(0, description.length - 5);
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/system_cache.dart ('k') | sdk/lib/_internal/pub/test/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698