Shalom Halbert
11/28/2021, 3:53 AMimport arrow.core.Either
import io.kotest.matchers.shouldBe
import io.kotest.matchers.types.shouldBeTypeOf
inline fun <reified E : Throwable> Either<Throwable, *>.shouldBeLeftThrowableWithMessage(
expectedMessage: String
) =
apply {
isLeft() shouldBe true
mapLeft { throwable ->
throwable.shouldBeTypeOf<E>()
throwable.message shouldBe expectedMessage
}
}