summaryrefslogtreecommitdiff
path: root/test/testunit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-02 12:29:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-02 12:29:33 +0000
commitfe1ad67c28492e32b469bd24b6722588c3f6f7bc (patch)
treef588b2b8a39b4c9c38a6709a4d8da54fcaaaadee /test/testunit
parentd49fca8894d05d124277f6be448994f3f7ccdcc6 (diff)
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.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/testunit/test_assertion.rb b/test/testunit/test_assertion.rb
index 7e772cc..0c7c488 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