Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a useful combinator to FutureMatchers.

  • Loading branch information...
commit 0eda2426cb14c5118d141704d055fc61957e8606 1 parent fa4a8c7
@nuttycom nuttycom authored
View
2  akka_testing/src/main/scala/blueeyes/akka_testing/FutureMatchers.scala
@@ -32,6 +32,8 @@ trait FutureMatchers extends AkkaConversions {
implicit val defaultFutureTimeouts: FutureTimeouts = FutureTimeouts(10, 100L millis)
+ def awaited[A](duration: Duration)(matcher: Matcher[A]) = matcher ^^ { (future: Future[A]) => Await.result(future, duration) }
+
case class whenDelivered[A](matcher: Matcher[A])(implicit timeouts: FutureTimeouts) extends Matcher[Future[A]] with Expectations {
def apply[B <: Future[A]](expectable: Expectable[B]): MatchResult[B] = {
val (ok, okMessage, koMessage) = retry(expectable.evaluate.value, timeouts.retries, timeouts.retries)
Please sign in to comment.
Something went wrong with that request. Please try again.