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

Unified Diff: pkg/mock/lib/src/result_matcher.dart

Issue 1115483002: remove pkg/mock (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | « pkg/mock/lib/src/responder.dart ('k') | pkg/mock/lib/src/result_set_matcher.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mock/lib/src/result_matcher.dart
diff --git a/pkg/mock/lib/src/result_matcher.dart b/pkg/mock/lib/src/result_matcher.dart
deleted file mode 100644
index aaf58069f1e5b58131ac7b66c938ca34ff623251..0000000000000000000000000000000000000000
--- a/pkg/mock/lib/src/result_matcher.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-library mock.result_matcher;
-
-import 'package:matcher/matcher.dart';
-
-import 'action.dart';
-import 'log_entry.dart';
-
-/**
- * [_ResultMatcher]s are used to make assertions about the results
- * of method calls. These can be used as optional parameters to [getLogs].
- */
-class _ResultMatcher extends Matcher {
- final Action action;
- final Matcher value;
-
- const _ResultMatcher(this.action, this.value);
-
- bool matches(item, Map matchState) {
- if (item is! LogEntry) {
- return false;
- }
- // normalize the action; _PROXY is like _RETURN.
- Action eaction = item.action;
- if (eaction == Action.PROXY) {
- eaction = Action.RETURN;
- }
- return (eaction == action && value.matches(item.value, matchState));
- }
-
- Description describe(Description description) {
- description.add(' to ');
- if (action == Action.RETURN || action == Action.PROXY) {
- description.add('return ');
- } else {
- description.add('throw ');
- }
- return description.addDescriptionOf(value);
- }
-
- Description describeMismatch(item, Description mismatchDescription,
- Map matchState, bool verbose) {
- if (item.action == Action.RETURN || item.action == Action.PROXY) {
- mismatchDescription.add('returned ');
- } else {
- mismatchDescription.add('threw ');
- }
- mismatchDescription.add(item.value);
- return mismatchDescription;
- }
-}
-
-/**
- *[returning] matches log entries where the call to a method returned
- * a value that matched [value].
- */
-Matcher returning(value) =>
- new _ResultMatcher(Action.RETURN, wrapMatcher(value));
-
-/**
- *[throwing] matches log entrues where the call to a method threw
- * a value that matched [value].
- */
-Matcher throwing(value) =>
- new _ResultMatcher(Action.THROW, wrapMatcher(value));
« no previous file with comments | « pkg/mock/lib/src/responder.dart ('k') | pkg/mock/lib/src/result_set_matcher.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698