summaryrefslogtreecommitdiff
path: root/test/ruby/test_comparable.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-18 21:27:18 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-18 21:27:18 +0000
commita81dfc3f6e7d794c53cac88237d8c2d869f0a46a (patch)
treebf66f14449eef602d9e8c33b62f0edbae7be04f2 /test/ruby/test_comparable.rb
parent971ef822679dfa6ee63ff83a47b4e4d1aa60d146 (diff)
* 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
Diffstat (limited to 'test/ruby/test_comparable.rb')
-rw-r--r--test/ruby/test_comparable.rb6
1 files changed, 4 insertions, 2 deletions
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