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

Unified Diff: test/pubspec_test.dart

Issue 2044253003: Refactor Source and SourceRegistry. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Rename LiveSource to BoundSource. Created 4 years, 6 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 | « test/package_list_files_test.dart ('k') | test/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/pubspec_test.dart
diff --git a/test/pubspec_test.dart b/test/pubspec_test.dart
index 4a3d219a191263e28572c656a478797319141d9e..24a68be46922b0b6c3aceac77dae3ba6518cbf21 100644
--- a/test/pubspec_test.dart
+++ b/test/pubspec_test.dart
@@ -2,30 +2,20 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:async';
-
import 'package:pub/src/package.dart';
import 'package:pub/src/pubspec.dart';
import 'package:pub/src/source.dart';
import 'package:pub/src/source/path.dart';
import 'package:pub/src/source_registry.dart';
+import 'package:pub/src/system_cache.dart';
import 'package:pub_semver/pub_semver.dart';
import 'package:test/test.dart';
class MockSource extends Source {
final String name = "mock";
- Future<List<PackageId>> doGetVersions(PackageRef ref) =>
- throw new UnsupportedError("Cannot get mock package versions.");
-
- Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError(
- "Cannot describe mock packages.");
-
- Future get(PackageId id, String symlink) => throw new UnsupportedError(
- "Cannot get a mock package.");
-
- String getDirectory(PackageId id) => throw new UnsupportedError(
- "Cannot get the directory for mock packages.");
+ BoundSource bind(SystemCache cache) =>
+ throw new UnsupportedError("Cannot download mock packages.");
PackageRef parseRef(String name, description, {String containingPath}) {
if (description != 'ok') throw new FormatException('Bad');
@@ -45,7 +35,6 @@ main() {
group('parse()', () {
var sources = new SourceRegistry();
sources.register(new MockSource());
- sources.register(new PathSource());
var throwsPubspecException =
throwsA(new isInstanceOf<PubspecException>());
« no previous file with comments | « test/package_list_files_test.dart ('k') | test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698