diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-02 12:29:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-02 12:29:33 +0000 |
commit | fe1ad67c28492e32b469bd24b6722588c3f6f7bc (patch) | |
tree | f588b2b8a39b4c9c38a6709a4d8da54fcaaaadee /test/testunit | |
parent | d49fca8894d05d124277f6be448994f3f7ccdcc6 (diff) | |
download | ruby-fe1ad67c28492e32b469bd24b6722588c3f6f7bc.tar.gz |
assertions.rb: fix return in assert_raise
* test/lib/test/unit/assertions.rb (assert_raise): should fail if
returned gently in the given block without any exceptions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/testunit')
-rw-r--r-- | test/testunit/test_assertion.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/testunit/test_assertion.rb b/test/testunit/test_assertion.rb index 7e772cc7b9..0c7c4882b8 100644 --- a/test/testunit/test_assertion.rb +++ b/test/testunit/test_assertion.rb @@ -14,4 +14,16 @@ class TestAssertion < Test::Unit::TestCase end; end end + + def return_in_assert_raise + assert_raise(RuntimeError) do + return + end + end + + def test_assert_raise + assert_raise(MiniTest::Assertion) do + return_in_assert_raise + end + end end |