MatcherImplicits

This trait adds some implicits to easily fold sequences of results

Companion:
object
class Object
trait Matchable
class Any
object MatcherImplicits.type

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 [T, S](f: T => S)
def ^^(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 [T, R](values: Iterable[T])
def atLeast(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(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(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(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(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(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(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(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(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(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