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

No way to validate thrown exceptions #12

Open
C06A opened this issue Dec 11, 2017 · 3 comments
Open

No way to validate thrown exceptions #12

C06A opened this issue Dec 11, 2017 · 3 comments

Comments

@C06A
Copy link

C06A commented Dec 11, 2017

It seams that framwork doesn't provide any way to check that tested code throws exception of specific kind. I guess test code can use try/catch, do fail if rich the end of try and do assertions in the catch clause. However this seams clunky and won't give correct nice message in case of failure.

I think the syntax for exceptions could be: expect(MyException::class).thrownBy {...}
If thrownBy returns the exception following code can validate details about it (message, cause, etc.).

Alternative syntax may be expect {...}.throws(MyException::class).

@C06A
Copy link
Author

C06A commented Dec 11, 2017

Actually I noticed the Pull Request from Dec 17, 2016 providing exception validation. It would be grate to merge it ASAP.

However it doesn't provide the way to check message, localized message, cause and whatever else exception may encapsulate. So consider this Issue to be enhancement on top of that merge.

@C06A
Copy link
Author

C06A commented Jun 23, 2019

No response for more than a year.

Does this mean that this project is abandoned?

@winterbe
Copy link
Owner

I'm sorry to say that this project is no longer actively maintained by me.

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