CustomAssertion

zio.test.CustomAssertion$
See theCustomAssertion companion class

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

final class MakePartiallyApplied[A]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

Creates a SmartAssertion from a function from A to Either[String, B]. Returning Right[A] will transform the input, whereas Left[String] will result in an error with that string as a message.

Creates a SmartAssertion from a function from A to Either[String, B]. Returning Right[A] will transform the input, whereas Left[String] will result in an error with that string as a message.

 sealed trait Color
 case object Red extends Color
 case object Green extends Color
 case object Blue extends Color

 val red: SmartAssertion[Color, Red] =
   SmartAssertion.make[Color] {
     case red: Red => Right(red)
     case _        => Left("Expected Red!")
   }

Attributes