MarkusAmshove / Kluent

Fluent Assertion-Library for Kotlin
https://markusamshove.github.io/Kluent/
MIT License
867 stars 64 forks source link

Potentially misleading behavior of shoudNotThrow #217

Open piotrb5e3 opened 2 years ago

piotrb5e3 commented 2 years ago

I think shouldNotThrow could hide a programming error.

The following code completes without issues:

invoking { throw IllegalArgumentException() } shouldNotThrow CustomException::class

I think the IllegalArgumentException should be re-thrown so it's not hidden from the developer.