# File test/unit/assertions.rb, line 289 def assert_nothing_thrown(message="", &proc) _wrap_assertion { assert(block_given?, "Should have passed a block to assertNothingThrown") begin proc.call rescue NameError => name_error if (name_error.message !~ /^uncaught throw `(.+)'$/ ) raise name_error end full_message = build_message(message, $1) { | arg | "Nothing should have been thrown but <:#{arg}> was thrown" } flunk(full_message) end full_message = build_message(message) { || "Nothing should have been thrown" } assert(true, full_message) } end