diff options
author | Nobuyoshi Nakada <[email protected]> | 2020-12-21 01:16:26 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2020-12-21 01:19:55 +0900 |
commit | 9c73c756244fa27ffa99d81dcc73a4ad14198002 (patch) | |
tree | 14b0ea9059b8c31e276531a1df712ead4e158cdb /spec/ruby/core/numeric | |
parent | fb8f011422c645ebe29e94c3fb2079af73d1d35f (diff) |
Use Integer instead of Fixnum/Bignum
Diffstat (limited to 'spec/ruby/core/numeric')
-rw-r--r-- | spec/ruby/core/numeric/denominator_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/numeric/quo_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/numeric/real_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/numeric/shared/imag.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/numeric/shared/rect.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/numeric/shared/step.rb | 16 |
6 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/core/numeric/denominator_spec.rb b/spec/ruby/core/numeric/denominator_spec.rb index 34729446a2..d347b280f5 100644 --- a/spec/ruby/core/numeric/denominator_spec.rb +++ b/spec/ruby/core/numeric/denominator_spec.rb @@ -6,7 +6,7 @@ describe "Numeric#denominator" do before :each do @numbers = [ 20, # Integer - 99999999**99, # Bignum + 99999999**99, # Integer ] end diff --git a/spec/ruby/core/numeric/quo_spec.rb b/spec/ruby/core/numeric/quo_spec.rb index 5c952b11a9..33b68a38f0 100644 --- a/spec/ruby/core/numeric/quo_spec.rb +++ b/spec/ruby/core/numeric/quo_spec.rb @@ -11,7 +11,7 @@ describe "Numeric#quo" do 2.quo(2.5).should eql(0.8) end - it "returns the result of self divided by the given Bignum as a Float" do + it "returns the result of self divided by the given Integer as a Float" do 45.quo(bignum_value).should be_close(1.04773789668636e-08, TOLERANCE) end diff --git a/spec/ruby/core/numeric/real_spec.rb b/spec/ruby/core/numeric/real_spec.rb index 2d2499bcce..8702dcc7c2 100644 --- a/spec/ruby/core/numeric/real_spec.rb +++ b/spec/ruby/core/numeric/real_spec.rb @@ -7,7 +7,7 @@ describe "Numeric#real" do 20, # Integer 398.72, # Float Rational(3, 4), # Rational - bignum_value, # Bignum + bignum_value, # Integer infinity_value, nan_value ].map{ |n| [n, -n] }.flatten diff --git a/spec/ruby/core/numeric/shared/imag.rb b/spec/ruby/core/numeric/shared/imag.rb index ac2da40a3b..0b46b0020b 100644 --- a/spec/ruby/core/numeric/shared/imag.rb +++ b/spec/ruby/core/numeric/shared/imag.rb @@ -6,7 +6,7 @@ describe :numeric_imag, shared: true do 20, # Integer 398.72, # Float Rational(3, 4), # Rational - bignum_value, # Bignum + bignum_value, # Integer infinity_value, nan_value ].map{|n| [n,-n]}.flatten diff --git a/spec/ruby/core/numeric/shared/rect.rb b/spec/ruby/core/numeric/shared/rect.rb index 9cde19a398..c56f3c48ae 100644 --- a/spec/ruby/core/numeric/shared/rect.rb +++ b/spec/ruby/core/numeric/shared/rect.rb @@ -6,7 +6,7 @@ describe :numeric_rect, shared: true do 20, # Integer 398.72, # Float Rational(3, 4), # Rational - 99999999**99, # Bignum + 99999999**99, # Integer infinity_value, nan_value ] diff --git a/spec/ruby/core/numeric/shared/step.rb b/spec/ruby/core/numeric/shared/step.rb index 6c47cdeecb..72f33016d4 100644 --- a/spec/ruby/core/numeric/shared/step.rb +++ b/spec/ruby/core/numeric/shared/step.rb @@ -24,9 +24,9 @@ describe :numeric_step, :shared => true do 1.0.step.first(5).should == [1.0, 2.0, 3.0, 4.0, 5.0] end - describe "when self, stop and step are Fixnums" do - it "yields only Fixnums" do - @step.call(1, 5, 1) { |x| x.should be_an_instance_of(Fixnum) } + describe "when self, stop and step are Integers" do + it "yields only Integers" do + @step.call(1, 5, 1) { |x| x.should be_an_instance_of(Integer) } end describe "with a positive step" do @@ -224,7 +224,7 @@ describe :numeric_step, :shared => true do end describe "when step is a String" do - describe "with self and stop as Fixnums" do + describe "with self and stop as Integers" do it "raises an ArgumentError when step is a numeric representation" do -> { @step.call(1, 5, "1") {} }.should raise_error(ArgumentError) -> { @step.call(1, 5, "0.1") {} }.should raise_error(ArgumentError) @@ -280,7 +280,7 @@ describe :numeric_step, :shared => true do end describe "when step is a String" do - describe "with self and stop as Fixnums" do + describe "with self and stop as Integers" do it "returns an Enumerator" do @step.call(1, 5, "foo").should be_an_instance_of(Enumerator) end @@ -296,7 +296,7 @@ describe :numeric_step, :shared => true do describe "returned Enumerator" do describe "size" do describe "when step is a String" do - describe "with self and stop as Fixnums" do + describe "with self and stop as Integers" do it "raises an ArgumentError when step is a numeric representation" do -> { @step.call(1, 5, "1").size }.should raise_error(ArgumentError) -> { @step.call(1, 5, "0.1").size }.should raise_error(ArgumentError) @@ -319,7 +319,7 @@ describe :numeric_step, :shared => true do end end - describe "when self, stop and step are Fixnums and step is positive" do + describe "when self, stop and step are Integers and step is positive" do it "returns the difference between self and stop divided by the number of steps" do @step.call(5, 10, 11).size.should == 1 @step.call(5, 10, 6).size.should == 1 @@ -336,7 +336,7 @@ describe :numeric_step, :shared => true do end end - describe "when self, stop and step are Fixnums and step is negative" do + describe "when self, stop and step are Integers and step is negative" do it "returns the difference between self and stop divided by the number of steps" do @step.call(10, 5, -11).size.should == 1 @step.call(10, 5, -6).size.should == 1 |