Clarify the purpose of the message parameter of assertFailsWith

#KT-22869 Fixed
This commit is contained in:
Ilya Gorbunov
2018-09-25 09:01:34 +03:00
parent 9f9033870c
commit 21b71f3bb1
4 changed files with 22 additions and 5 deletions
@@ -17,7 +17,11 @@ actual fun todo(block: () -> Unit) {
}
/** Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown. */
/**
* Asserts that a [block] fails with a specific exception of type [exceptionClass] being thrown.
*
* If the assertion fails, the specified [message] is used unless it is null as a prefix for the failure message.
*/
actual fun <T : Throwable> assertFailsWith(exceptionClass: KClass<T>, message: String?, block: () -> Unit): T {
val exception = assertFails(message, block)
@Suppress("INVISIBLE_MEMBER")