module Test::Unit::Assertions

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:

@example 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