Merge pull request #68 from DrMarcII/master
Fix dependencies.
diff --git a/lib/async_helpers.dart b/lib/async_helpers.dart
index 121a824..b0d7609 100644
--- a/lib/async_helpers.dart
+++ b/lib/async_helpers.dart
@@ -16,7 +16,7 @@
import 'dart:async' show Completer, Future;
-import 'package:test/test.dart' show expect, isNotNull;
+import 'package:matcher/matcher.dart';
const defaultInterval = const Duration(milliseconds: 500);
const defaultTimeout = const Duration(seconds: 5);
@@ -49,6 +49,31 @@
Future waitFor(condition(), {matcher: isNotNull,
Duration timeout: defaultTimeout,
Duration interval: defaultInterval}) async {
+ expect(value, matcher) {
+ if (matcher is! Matcher) {
+ matcher = equals(matcher);
+ }
+
+ var matchState = {};
+ if (matcher.matches(value, matchState)) {
+ return;
+ }
+ var desc = new StringDescription()
+ ..add('Expected: ')
+ ..addDescriptionOf(matcher)
+ ..add('\n')
+ ..add(' Actual: ')
+ ..addDescriptionOf(value)
+ ..add('\n');
+
+ var mismatchDescription = new StringDescription();
+ matcher.describeMismatch(value, mismatchDescription, matchState);
+ if (mismatchDescription.length > 0) {
+ desc.add(' Which: ${mismatchDescription}\n');
+ }
+ throw new Exception(desc.toString());
+ }
+
var endTime = now.add(timeout);
while (true) {
try {
diff --git a/pubspec.yaml b/pubspec.yaml
index 50da3fc..31a3a71 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -9,6 +9,8 @@
sdk: '>=1.9.0 <2.0.0'
dependencies:
crypto: '^0.9.0'
- test: '^0.12.0-rc.1'
+ matcher: '^0.12.0-alpha.0'
dev_dependencies:
path: '^1.3.5'
+ test: '^0.12.0-rc.1'
+