Skip to content

Latest commit

 

History

History

kaval-kotest

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Kaval kotest

Provide matchers for kotest

Provided matchers

beValidFor

Check an element with his validator

val validator: Validator<String> = TODO("pick your validator")
"plop" should beValidFor(validator)

beValid

Check a ValidationResult is Valid

val validator: Validator<String> = TODO("pick your validator")
validator.validate("plop") should beValid()

beInvalid

Check a ValidationResult is Invalid

val validator: Validator<String> = TODO("pick your validator")
validator.validate("plop") should beInvalid()

beInvalidOnField

Check a ValidationResult have an issue on a specific field

val validator: Validator<String> = TODO("pick your validator")
validator.validate("plop") should beInvalidOnField("length")

beInvalidWithReason

Check a ValidationResult have an issue with a specific message

val validator: Validator<String> = TODO("pick your validator")
validator.validate("plop") should beInvalidWithReason("requires to be not empty")

beInvalidWithAllReasons

Check a ValidationResult have some issues with specific messages

val validator: Validator<String> = TODO("pick your validator")
validator.validate("plop") should beInvalidWithAllReasons(
    "requires to be not empty",
    "requires matching '^[a-z]*$'"
)

beInvalidWithAny

Check a ValidationResult have an issue matching a kotest Matcher

val validator: Validator<String> = TODO("pick your validator")
validator.validate("plop") should beInvalidWithAny(beLowerCase())