summaryrefslogtreecommitdiff
path: root/test/ruby/test_rational.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-11 19:20:53 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-11 20:04:29 +0900
commit3e7d002118a92fad5934e11c75be6768a1476c1b (patch)
treee9f437327b5c743622a97c092ddadc2d99cb0bc5 /test/ruby/test_rational.rb
parentcd069df36596d9bf7a6db8aaa0dcefdafb233a91 (diff)
Check exception flag as a bool [Bug #15987]
Diffstat (limited to 'test/ruby/test_rational.rb')
-rw-r--r--test/ruby/test_rational.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb
index a8cdf22a49..301890b620 100644
--- a/test/ruby/test_rational.rb
+++ b/test/ruby/test_rational.rb
@@ -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))