TrimmedAsserts

Contains wrappers for Kotest's assertions which catch AssertionErrors and clean up stack traces before rethrowing.

Inheritors

Functions

Link copied to clipboard
open infix fun <T, U : T> T.shouldBe(expected: U?)

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

open infix fun String.shouldBe(expected: String)

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

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

Treat sequences like lists when asserting.

Link copied to clipboard
open infix fun String.shouldBeNoTrimIndent(expected: String)

An alternative to the overloaded String-only shouldBe, since the overloaded version automatically applies trimIndent.

Link copied to clipboard
open infix fun File.shouldHaveText(expected: String)

reads the file's text and asserts

Link copied to clipboard
open fun <T, U : T> T.trimmedShouldBe(expected: U?, vararg excludeFromStack: KClass<*>)

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