From a81dfc3f6e7d794c53cac88237d8c2d869f0a46a Mon Sep 17 00:00:00 2001 From: eregon Date: Sat, 18 Jan 2014 21:27:18 +0000 Subject: * test/ruby/test_comparable.rb: specify behavior for the different kind of exceptions rescued (or not) by Comparable#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_comparable.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/ruby/test_comparable.rb b/test/ruby/test_comparable.rb index 6c58e5d365..e734e8b979 100644 --- a/test/ruby/test_comparable.rb +++ b/test/ruby/test_comparable.rb @@ -17,9 +17,11 @@ class TestComparable < Test::Unit::TestCase assert_equal(true, @o == nil) cmp->(x) do 1; end assert_equal(false, @o == nil) + cmp->(x) do raise NotImplementedError, "Not a RuntimeError" end + assert_raise(NotImplementedError) { @o == nil } bug7688 = '[ruby-core:51389] [Bug #7688]' - cmp->(x) do raise NotImplementedError; end - assert_raise(NotImplementedError, bug7688) { @o == nil } + cmp->(x) do raise StandardError, "Even a standard error should not be rescued"; end + assert_raise(StandardError, bug7688) { @o == nil } end def test_gt -- cgit v1.2.3