method
assert_throw
ruby latest stable - Class:
Test::Unit::Assertions
assert_throw(tag, msg = nil)public
Fails unless the given block throws tag, returns the caught value otherwise.
An optional failure message may be provided as the final argument.
tag = Object.new assert_throw(tag, "#{tag} was not thrown!") do throw tag end