1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-07-29 22:11:21 +02:00
parent 15d05f8120
commit 6998d75824
186 changed files with 3956 additions and 3339 deletions

View file

@ -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