mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
971ef82267
commit
a81dfc3f6e
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue