mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 04:24:04 +02:00
Check exception flag as a bool [Bug #15987]
This commit is contained in:
parent
cd069df365
commit
3e7d002118
12 changed files with 92 additions and 42 deletions
|
@ -808,6 +808,12 @@ class Rational_Test < Test::Unit::TestCase
|
|||
assert_raise(ZeroDivisionError) {Rational("1/0")}
|
||||
end
|
||||
|
||||
def test_Rational_with_invalid_exception
|
||||
assert_raise(ArgumentError) {
|
||||
Rational("1/1", exception: 1)
|
||||
}
|
||||
end
|
||||
|
||||
def test_Rational_without_exception
|
||||
assert_nothing_raised(ArgumentError) {
|
||||
assert_equal(nil, Rational("5/3x", exception: false))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue