Validatable
Container class for matching success type stuff in cats.data.Validated
containers, similar to
org.scalatest.OptionValues.Valuable
Meant to allow you to make statements like:
result.value should be > 15 result.valid.value should be(Valid(15))
Where it only matches if result is Valid(9)
Otherwise your test will fail, indicating that it was left instead of right
- Value parameters:
- validated
A
cats.data.Validated
object to try converting to aValidatable
- See also:
org.scalatest.OptionValues.Valuable
Value members
Concrete methods
Returns the Validated
passed to the constructor as an Invalid
, if it is an
Invalid
, else throws TestFailedException
with a detail message indicating the
Validated
was not an Invalid
.
Returns the Validated
passed to the constructor as an Invalid
, if it is an
Invalid
, else throws TestFailedException
with a detail message indicating the
Validated
was not an Invalid
.
Allow .invalidValue on an validated to extract the invalid side. Like .value, but for the Invalid
.
Allow .invalidValue on an validated to extract the invalid side. Like .value, but for the Invalid
.
Returns the Validated
passed to the constructor as a Valid
, if it is a
Valid
, else throws TestFailedException
with a detail message indicating the
Validated
was not a Valid
.
Returns the Validated
passed to the constructor as a Valid
, if it is a
Valid
, else throws TestFailedException
with a detail message indicating the
Validated
was not a Valid
.