Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kluent cannot use shouldThrow on nullable functions #63

Closed
gregwoodfill opened this issue Sep 16, 2017 · 1 comment
Closed

Kluent cannot use shouldThrow on nullable functions #63

gregwoodfill opened this issue Sep 16, 2017 · 1 comment

Comments

@gregwoodfill
Copy link
Contributor

Kluent's should*Throw only works on lambdas that return non-null.
The code below does not compile as shouldNotThrow is an extension on Any, not Any?

val func = { null }
func shouldNotThrow AnyException
gregwoodfill added a commit to gregwoodfill/Kluent that referenced this issue Sep 16, 2017
gregwoodfill added a commit to gregwoodfill/Kluent that referenced this issue Sep 16, 2017
Make `should not throw` and `should throw` extensions on Any? instead of Any.
This allows nullable functions to use `should throw` and `should not throw`.
Also moving test for shouldNotThrow into correct test class.
MarkusAmshove added a commit that referenced this issue Sep 19, 2017
Allow should(Not)Throw on nullable lambdas Kluent #63
@MarkusAmshove
Copy link
Owner

This willl be in the next version (1.30).
Thanks for your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants