All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.gianluigip.spectacle.dsl.assertions.ThrowableAssertionsExtensions.kt Maven / Gradle / Ivy

The newest version!
package io.gianluigip.spectacle.dsl.assertions

import kotlin.reflect.KClass
import kotlin.test.assertTrue

private val Throwable.expectedTo get() = "Expected '${this::class.simpleName}' to"

@AssertionDslMarker
infix fun Throwable.shouldBeCausedBy(expected: KClass<*>) =
    assertTrue(expected.isInstance(this.cause), "$expectedTo be caused by ${expected.simpleName}")




© 2015 - 2024 Weber Informatics LLC | Privacy Policy