File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/main/kotlin/in/rcard/assertj/arrowcore Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ class RaiseAssert<ERROR : Any, VALUE : Any>(
4141
4242 /* *
4343 * Verifies that the function in the [Raise] context throws an exception.
44+ * ### Example:
45+ * ```kotlin
46+ * val throwsException: Raise<String>.() -> Int = {
47+ * throw RuntimeException("AN EXCEPTION")
48+ * }
49+ * assertThatThrownBy { throwsException() }
50+ * .isInstanceOf(RuntimeException::class.java)
51+ * .hasMessage("AN EXCEPTION")
52+ * ```
53+ *
4454 * @param shouldRaiseThrowable the function to be executed in the [Raise] context.
4555 * @return the [AbstractThrowableAssert] to be used to verify the exception.
4656 */
@@ -63,6 +73,11 @@ class RaiseAssert<ERROR : Any, VALUE : Any>(
6373
6474 /* *
6575 * Verifies that the function in the [Raise] context raises an error.
76+ * ### Example:
77+ * ```kotlin
78+ * val raisesError: Raise<String>.() -> Int = { raise("LOGICAL ERROR") }
79+ * assertThatRaisedBy { raisesError() }.isEqualTo("LOGICAL ERROR")
80+ * ```
6681 * @param shouldRaiseError the function to be executed in the [Raise] context.
6782 * @return the [AbstractObjectAssert] to be used to verify the error.
6883 */
You can’t perform that action at this time.
0 commit comments