ValidatedMatchers

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

Value members

Concrete methods

def beInvalid[E](element: E): Matcher[Validated[E, _]]

Checks if a cats.data.Validated is a specific Invalid element.

Checks if a cats.data.Validated is a specific Invalid element.

def beValid[T](element: T): Matcher[Validated[_, T]]

Checks if a cats.data.Validated is an instance of Valid.

Checks if a cats.data.Validated is an instance of Valid.

def haveAnInvalid[E : Typeable]: Matcher[Validated[NonEmptyList[Any], _]]

Checks if a cats.data.ValidatedNel contains a failure element matching a specific type Usage:

Checks if a cats.data.ValidatedNel contains a failure element matching a specific type Usage:

 validationObj should haveAnInvalid[someErrorType]

Can also be used to test multiple elements: `

validationObj should (haveAnInvalid[someErrorType] and
                     haveAnInvalid[someOtherErrorType])
def haveInvalid[E](element: E): Matcher[Validated[NonEmptyList[E], _]]

Checks if a cats.data.ValidatedNel contains a specific failure element Usage:

Checks if a cats.data.ValidatedNel contains a specific failure element Usage:

 validationObj should haveInvalid (someErrorMessageOrObject)

Can also be used to test multiple elements: `

validationObj should (haveInvalid (someErrorMessageOrObject) and
                     haveInvalid (someOtherErrorMessageOrObject))
def invalid[E]: BeMatcher[Validated[E, _]]

Checks if the cats.data.Validated is an Invalid.

Checks if the cats.data.Validated is an Invalid.

def valid[T]: BeMatcher[Validated[_, T]]

Checks if a cats.data.Validated is a Valid.

Checks if a cats.data.Validated is a Valid.