method
assert_nothing_thrown
v1_9_2_180 -
Show latest stable
- Class:
Test::Unit::Assertions
assert_nothing_thrown(msg=nil)public
No documentation available.
# File lib/test/unit/assertions.rb, line 53
def assert_nothing_thrown(msg=nil)
begin
yield
rescue ArgumentError => error
raise error if /\Auncaught throw (.+)\z/ !~ error.message
msg = message(msg) { "<#{$1}> was thrown when nothing was expected" }
flunk(msg)
end
assert(true, "Expected nothing to be thrown")
end