Skip to content

Commit ef5c8b9

Browse files
committed
docs(68): Added some documentation to RaiseAssert methods
1 parent edd6ac6 commit ef5c8b9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/kotlin/in/rcard/assertj/arrowcore/RaiseAssert.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*/

0 commit comments

Comments
 (0)