module
v1_8_6_287 -
Show latest stable
-
0 notes
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378 (-38)
- 1_9_2_180 (0)
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
Test::Unit::Assertions contains the standard Test::Unit assertions. Assertions is included in Test::Unit::TestCase.
To include it in your own code and use its functionality, you simply need to rescue Test::Unit::AssertionFailedError. Additionally you may override add_assertion to get notified whenever an assertion is made.
Notes:
- The message to each assertion, if given, will be propagated with the failure.
- It is easy to add your own assertions based on assert_block().
Example Custom Assertion
def deny(boolean, message = nil) message = build_message message, '<?> is not false or nil.', boolean assert_block message do not boolean end end
Constants
UncaughtThrow = {NameError => /^uncaught throw \`(.+)\'$/, ThreadError => /^uncaught throw \`(.+)\' in thread /}