# File test/unit/assertions.rb, line 273 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 => name_error if (name_error.message !~ /^uncaught throw `(.+)'$/ ) #` raise name_error end full_message = build_message(message, $1) do |arg| "<:#{arg}> was thrown when nothing was expected" end flunk(full_message) end full_message = build_message(message) { || "Expected nothing to be thrown" } assert(true, full_message) end end