Introduce 'fail' method to throw AssertionError with cause

#KT-37804
This commit is contained in:
Ilya Gorbunov
2020-01-26 00:02:43 +03:00
parent d2ff98fcb1
commit 2bb36899da
11 changed files with 95 additions and 13 deletions
@@ -53,8 +53,15 @@ object JUnit5Asserter : Asserter {
}
override fun fail(message: String?): Nothing {
Assertions.fail<Any>(message)
Assertions.fail<Any?>(message)
// should not get here
throw AssertionError(message)
}
@SinceKotlin("1.4")
override fun fail(message: String?, cause: Throwable?): Nothing {
Assertions.fail<Any?>(message, cause)
// should not get here
throw AssertionError(message, cause)
}
}