MatcherImplicits

This trait adds some implicits to easily fold sequences of results

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def atLeastOnceWhen[T, R](values: Iterable[T])(f: PartialFunction[T, R])(using evidence$15: AsResult[R]): Result

verify the function f for at least one value, where the PartialFunction is defined

verify the function f for at least one value, where the PartialFunction is defined

def atMostOnceWhen[T, R](values: Iterable[T])(f: PartialFunction[T, R])(using evidence$16: AsResult[R]): Result

verify the function f for at least one value, where the PartialFunction is defined

verify the function f for at least one value, where the PartialFunction is defined

def forall[T, R](values: Iterable[T])(f: T => R)(using evidence$11: AsResult[R]): Result

verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined

verify the function f for all the values, stopping after the first failure, where the PartialFunction is defined

def forallWhen[T, R](values: Iterable[T])(f: PartialFunction[T, R])(using evidence$12: AsResult[R]): Result
def foreach[T, R](values: Iterable[T])(f: T => R)(using evidence$13: AsResult[R]): Result

verify the function f for all the values, and collect all failures

verify the function f for all the values, and collect all failures

def foreachWhen[T, R](values: Iterable[T])(f: PartialFunction[T, R])(using evidence$14: AsResult[R]): Result

verify the function f for all the values, and collect all failures, where the PartialFunction is defined

verify the function f for all the values, and collect all failures, where the PartialFunction is defined

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 (f: T => S)
def ^^[T, S](m: Matcher[S]): Matcher[T]

this extension provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases:

this extension provides an inverted syntax to adapt matchers to make the adaptation more readable in some cases:

  • def haveExtension(extension: =>String) = ((_:File).getPath) ^^ endWith(extension)
extension (values: Iterable[T])
def atLeast[T, R](n: Times)(f: T => R)(using evidence$3: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def atLeast[T, R](n: Int)(f: T => R)(using evidence$4: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def atLeastOnce[T, R](f: T => R)(using evidence$1: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def atMost[T, R](n: Times)(f: T => R)(using evidence$5: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def atMost[T, R](n: Int)(f: T => R)(using evidence$6: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def atMostOnce[T, R](f: T => R)(using evidence$2: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def between[T, R](min: Times, max: Times)(f: T => R)(using evidence$7: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def between[T, R](min: Int, max: Int)(f: T => R)(using evidence$8: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def exactly[T, R](n: Times)(f: T => R)(using evidence$9: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements

def exactly[T, R](n: Int)(f: T => R)(using evidence$10: AsResult[R]): Result

Extend collections to check all their elements

Extend collections to check all their elements