Skip to content
This repository
Browse code

Added a useful combinator to FutureMatchers.

  • Loading branch information...
commit 0eda2426cb14c5118d141704d055fc61957e8606 1 parent fa4a8c7
Kris Nuttycombe nuttycom authored
2  akka_testing/src/main/scala/blueeyes/akka_testing/FutureMatchers.scala
@@ -32,6 +32,8 @@ trait FutureMatchers extends AkkaConversions {
32 32
33 33 implicit val defaultFutureTimeouts: FutureTimeouts = FutureTimeouts(10, 100L millis)
34 34
  35 + def awaited[A](duration: Duration)(matcher: Matcher[A]) = matcher ^^ { (future: Future[A]) => Await.result(future, duration) }
  36 +
35 37 case class whenDelivered[A](matcher: Matcher[A])(implicit timeouts: FutureTimeouts) extends Matcher[Future[A]] with Expectations {
36 38 def apply[B <: Future[A]](expectable: Expectable[B]): MatchResult[B] = {
37 39 val (ok, okMessage, koMessage) = retry(expectable.evaluate.value, timeouts.retries, timeouts.retries)

0 comments on commit 0eda242

Please sign in to comment.
Something went wrong with that request. Please try again.