shouldBe

open infix fun String.shouldBe(expected: String)(source)

A special String-only version of shouldBe which calls trimIndent first.


open infix fun <T, U : T> T.shouldBe(expected: U?)(source)

Delegates to Kotest's shouldBe, but removes all the noise at the beginning of a stacktrace, like:

at app//kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at app//kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)

See also


open infix fun Sequence<*>.shouldBe(expected: List<*>)(source)

Treat sequences like lists when asserting.