FutureMatchers

This trait is for transforming matchers of values to matchers of Futures

Companion:
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def await[T](m: Matcher[T])(using ee: ExecutionEnv, nothing: Int): Matcher[Future[T]]
def await[T](m: Matcher[T])(retries: Int, timeout: FiniteDuration)(using ee: ExecutionEnv): Matcher[Future[T]]
def awaitFor[T](m: Matcher[T])(timeout: FiniteDuration)(using ee: ExecutionEnv): Matcher[Future[T]]
def retry[T](m: Matcher[T])(retries: Int)(using ee: ExecutionEnv): Matcher[Future[T]]

Inherited methods

protected def checkResultFailure(r: => Result): Result

this method can be overridden to throw exceptions when checking a result

this method can be overridden to throw exceptions when checking a result

Inherited from:
ResultChecks
def createExpectable[T](t: => T, alias: String => String): Expectable[T]
Returns:

an Expectable with a description function

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T, alias: => String): Expectable[T]
Returns:

an Expectable with a description

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T): Expectable[T]
Returns:

an Expectable

Inherited from:
ExpectationsCreation
def createExpectable[T](t: => T, alias: Option[String => String]): Expectable[T]
Returns:

an Expectable with a description function

Inherited from:
ExpectationsCreation
def createExpectableWithShowAs[T](t: => T, showAs: => String): Expectable[T]
Returns:

an Expectable with a function to show the element T

Inherited from:
ExpectationsCreation
protected def mapResult(r: Result): Result

this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure

this method can be overridden to intercept a Result and modify it. It is used for example to set a stacktrace providing the location of a failure

Inherited from:
ResultChecks
protected def sandboxResult(r: => Result): Result
Returns:

the result without any side-effects

Inherited from:
ResultChecks
protected def setStacktrace(m: Result): Result

this method can be overridden to avoid filling-in a stacktrace indicating the location of the result

this method can be overridden to avoid filling-in a stacktrace indicating the location of the result

Inherited from:
MatchResultStackTrace
def theBlock(t: => Nothing): Expectable[Nothing]
Inherited from:
ExpectationsCreation
def theValue[T](t: => T): Expectable[T]
Inherited from:
ExpectationsCreation

Extensions

Extensions

extension [T](m: Matcher[T])
def await(using ee: ExecutionEnv): Matcher[Future[T]]

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

def await(using ee: ExecutionEnv)(retries: Int, timeout: FiniteDuration): Matcher[Future[T]]

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

def awaitFor(using ee: ExecutionEnv)(timeout: FiniteDuration): Matcher[Future[T]]

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

def retryAwait(using ee: ExecutionEnv)(retries: Int): Matcher[Future[T]]

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

add an await method to any matcher Matcher[T] so that it can be transformed into a Matcher[Future[T]] making this implicit an extension method does not work out of the box

Implicits

Implicits

implicit def futureToResult[T](f: => Future[T])(using ee: ExecutionEnv, asResult: AsResult[T]): FutureAsResult[T]

when a Future contains a result, it can be awaited to return this result

when a Future contains a result, it can be awaited to return this result