public class FailuresKt
| Modifier and Type | Method and Description |
|---|---|
static java.lang.AssertionError |
shouldFail(kotlin.jvm.functions.Function0<? extends java.lang.Object> block)
Verifies that block throws an AssertionError
|
public static java.lang.AssertionError shouldFail(kotlin.jvm.functions.Function0<? extends java.lang.Object> block)
Verifies that block throws an AssertionError
If block throws an AssertionError, this method will pass. Otherwise, it will throw an error, as a failure was expected.
This should be used mainly to check that an assertion fails, for example:
shouldFail {
1 shouldBe 2 // This should fail
}