kotest-assertions-core / io.kotest.matchers.string / beTruthy

beTruthy

fun beTruthy(): Matcher<String?>

Matcher checks that string is truthy.

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

"1" should beTruthy()       // Assertion passes
"YeS" should beTruthy()     // Assertion passes
"Y" should beTruthy()       // Assertion passes

"no" should beTruthy()      // Assertion fails
"yes" shouldNot beTruthy()  // Assertion fails