MarkusAmshove / Kluent

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

Added `should throw` and `should not throw` assertions that operate on suspending functions #216

Closed piotrb5e3 closed 2 years ago

piotrb5e3 commented 2 years ago

Description

I added support for suspend functions in should throw and should not throw, as requested in #215. I also wrote tests for should throw and should not throw that check behavior on both suspending and regular functions.

Usage examples

coInvoking { foo() } `should throw` CustomException(12345)
coInvoking { bar() } `should not throw` CustomException::class

Checklist

MarkusAmshove commented 2 years ago

Thank you very much for the contribution :)