diff options
author | Benoit Daloze <eregontp@gmail.com> | 2021-07-29 22:11:21 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2021-07-29 22:11:21 +0200 |
commit | 6998d758248d778fa95b008c78d05473e48b8428 (patch) | |
tree | 8abc6926f647ea5f374a5b34c3a4820c5861e32e /spec/ruby/shared | |
parent | 15d05f8120745a121b93fab9fd2addf5f094e8d2 (diff) | |
download | ruby-6998d758248d778fa95b008c78d05473e48b8428.tar.gz |
Update to ruby/spec@b65d01f
Diffstat (limited to 'spec/ruby/shared')
-rw-r--r-- | spec/ruby/shared/rational/Rational.rb | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/spec/ruby/shared/rational/Rational.rb b/spec/ruby/shared/rational/Rational.rb index 2c36243dc3..936a90c086 100644 --- a/spec/ruby/shared/rational/Rational.rb +++ b/spec/ruby/shared/rational/Rational.rb @@ -101,42 +101,40 @@ describe :kernel_Rational, shared: true do end end - ruby_version_is "2.6" do - describe "when passed exception: false" do - describe "and [non-Numeric]" do - it "swallows an error" do - Rational(:sym, exception: false).should == nil - Rational("abc", exception: false).should == nil - end + describe "when passed exception: false" do + describe "and [non-Numeric]" do + it "swallows an error" do + Rational(:sym, exception: false).should == nil + Rational("abc", exception: false).should == nil end + end - describe "and [non-Numeric, Numeric]" do - it "swallows an error" do - Rational(:sym, 1, exception: false).should == nil - Rational("abc", 1, exception: false).should == nil - end + describe "and [non-Numeric, Numeric]" do + it "swallows an error" do + Rational(:sym, 1, exception: false).should == nil + Rational("abc", 1, exception: false).should == nil end + end - describe "and [anything, non-Numeric]" do - it "swallows an error" do - Rational(:sym, :sym, exception: false).should == nil - Rational("abc", :sym, exception: false).should == nil - end + describe "and [anything, non-Numeric]" do + it "swallows an error" do + Rational(:sym, :sym, exception: false).should == nil + Rational("abc", :sym, exception: false).should == nil end + end - describe "and non-Numeric String arguments" do - it "swallows an error" do - Rational("a", "b", exception: false).should == nil - Rational("a", 0, exception: false).should == nil - Rational(0, "b", exception: false).should == nil - end + describe "and non-Numeric String arguments" do + it "swallows an error" do + Rational("a", "b", exception: false).should == nil + Rational("a", 0, exception: false).should == nil + Rational(0, "b", exception: false).should == nil end + end - describe "and nil arguments" do - it "swallows an error" do - Rational(nil, exception: false).should == nil - Rational(nil, nil, exception: false).should == nil - end + describe "and nil arguments" do + it "swallows an error" do + Rational(nil, exception: false).should == nil + Rational(nil, nil, exception: false).should == nil end end end |