assertions.rb: fix return value

* lib/test/unit/assertions.rb (assert_throw): should return the
  caught value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-24 10:05:18 +00:00
parent df7fc7ce1b
commit 42d491cd1b

View File

@ -192,7 +192,7 @@ module Test
# throw tag
# end
def assert_throw(tag, msg = nil)
catch(tag) do
ret = catch(tag) do
begin
yield(tag)
rescue ArgumentError => e
@ -205,6 +205,7 @@ module Test
assert(false, msg)
end
assert(true)
ret
end
# :call-seq: