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

Feature Request: Support assertThrows with a message #1

Closed
bitspittle opened this issue Apr 1, 2022 · 1 comment
Closed

Feature Request: Support assertThrows with a message #1

bitspittle opened this issue Apr 1, 2022 · 1 comment

Comments

@bitspittle
Copy link
Collaborator

Currently, all the assertThat methods have assertWithMessage versions.

assertThrows is kind of special and I don't think we can do quite the same thing, but there should be some way to add support for a custom message.

I had a loop in some of my code that tested several inputs against an assertThrows check, but when one of them failed, I didn't have any idea of which one. It would have been nice to do something like

for (badInput in listOf(...)) {
   assertThrows<...>("Testing exceptions for input case $badInput...") { ... }
}
@bitspittle bitspittle changed the title assertThrows with a message Feature Request: Support assertThrows with a message Apr 4, 2022
@bitspittle
Copy link
Collaborator Author

(Will be fixed in 0.6.4, sorry it took me so long to revisit Truthish to close this out 😅 )

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

1 participant