kotest-assertions-core / io.kotest.matchers.string / kotlin.String / shouldBeTruthy

shouldBeTruthy

fun String?.shouldBeTruthy(): Unit

Assert that string should be truthy.

Verifies that string is equal to one of the values: true,yes,y,1. Assert is not case sensitive.

"1".shouldBeTruthy()     // Assertion passes
"YeS".shouldBeTruthy()   // Assertion passes
"Y".shouldBeTruthy()     // Assertion passes

"no".shouldBeTruthy()    // Assertion fails