# File lib/test/unit/assertions.rb, line 601 def assert_nothing_thrown(message="", &proc) _wrap_assertion do assert(block_given?, "Should have passed a block to assert_nothing_thrown") begin proc.call rescue NameError, ArgumentError, ThreadError => error raise unless UncaughtThrow[error.class] =~ error.message tag = $1 tag = tag[1..-1].intern if tag[0, 1] == ":" full_message = build_message(message, "<?> was thrown when nothing was expected", tag) flunk(full_message) end assert(true, "Expected nothing to be thrown") end end