Skip to content

Compatibility with Arrowopensavvy.prepared.compat.arrow.coreassertRaisesWith

assertRaisesWith

inline fun <Failure> assertRaisesWith(block: Raise<Any?>.() -> Any?)

Deprecated

This function has been renamed checkThrows.

Replace with

<div class="highlight"><pre><code class="md-code__content"><span markdown>opensavvy.prepared.compat.arrow.core.checkRaises<Failure>(block)
</span></code></pre></div>

Fails the test if block doesn't raise with a value of type Failure.

Example

test("√-1 raises") {
    assertRaisesWith<NegativeSquareRoot> {
        sqrt(-1.0)
    }
}