How to implement thrown() and noThrown() assertions in Spock where blocks. #2188
Unanswered
cunzhiwang
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The easiest probably is to split the test into two tests. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use a unit test method to implement assertions for throwing and not throwing exceptions by adding cases in the where block, but I cannot pass the Groovy compiler's checks, and the compiler reports an error: Groovyc: Exception conditions are only allowed as top-level statements.

Beta Was this translation helpful? Give feedback.
All reactions