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

Unified Diff: sdk/lib/_internal/pub/test/pubspec_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/test/lock_file_test.dart ('k') | sdk/lib/_internal/pub/test/version_solver_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/pubspec_test.dart
diff --git a/sdk/lib/_internal/pub/test/pubspec_test.dart b/sdk/lib/_internal/pub/test/pubspec_test.dart
index a730a14b514d98eb0fe02da7ee9f42b578d517c0..b8c42f6f4fc7fad6af75488d960676f0fcaf3fd5 100644
--- a/sdk/lib/_internal/pub/test/pubspec_test.dart
+++ b/sdk/lib/_internal/pub/test/pubspec_test.dart
@@ -4,8 +4,11 @@
library pubspec_test;
+import 'dart:async';
+
import 'package:unittest/unittest.dart';
+import '../lib/src/package.dart';
import '../lib/src/pubspec.dart';
import '../lib/src/source.dart';
import '../lib/src/source_registry.dart';
@@ -14,12 +17,25 @@ 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, description,
{bool fromLockFile: false}) {
if (description != 'ok') throw new FormatException('Bad');
return description;
}
+
+ bool descriptionsEqual(description1, description2) =>
+ description1 == description2;
+
String packageName(description) => 'foo';
}
« no previous file with comments | « sdk/lib/_internal/pub/test/lock_file_test.dart ('k') | sdk/lib/_internal/pub/test/version_solver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698