3

I have a set of tests that crash the whole test suite if a given situation arises. Moreover, that situation is already a failure for the suite.

Rather than crash, I'd rather test if the condition is true during the setup of the series, and fast-abort it with a failure.

Is that possible?

Kheldar
  • 5,361
  • 3
  • 34
  • 63

1 Answers1

4

Yes, you can fail a test at anytime with:

fail("And here you give the reason for the failure")
erickva
  • 513
  • 6
  • 17