From 9c73c756244fa27ffa99d81dcc73a4ad14198002 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 21 Dec 2020 01:16:26 +0900 Subject: Use Integer instead of Fixnum/Bignum --- spec/ruby/core/random/new_seed_spec.rb | 4 ++-- spec/ruby/core/random/new_spec.rb | 2 +- spec/ruby/core/random/rand_spec.rb | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'spec/ruby/core/random') diff --git a/spec/ruby/core/random/new_seed_spec.rb b/spec/ruby/core/random/new_seed_spec.rb index 4b34e871a2..7a93da99aa 100644 --- a/spec/ruby/core/random/new_seed_spec.rb +++ b/spec/ruby/core/random/new_seed_spec.rb @@ -1,8 +1,8 @@ require_relative '../../spec_helper' describe "Random.new_seed" do - it "returns a Bignum" do - Random.new_seed.should be_an_instance_of(Bignum) + it "returns an Integer" do + Random.new_seed.should be_an_instance_of(Integer) end it "returns an arbitrary seed value each time" do diff --git a/spec/ruby/core/random/new_spec.rb b/spec/ruby/core/random/new_spec.rb index 07d7b439ca..4280b5b9c3 100644 --- a/spec/ruby/core/random/new_spec.rb +++ b/spec/ruby/core/random/new_spec.rb @@ -4,7 +4,7 @@ describe "Random.new" do end it "uses a random seed value if none is supplied" do - Random.new.seed.should be_an_instance_of(Bignum) + Random.new.seed.should be_an_instance_of(Integer) end it "returns Random instances initialized with different seeds" do diff --git a/spec/ruby/core/random/rand_spec.rb b/spec/ruby/core/random/rand_spec.rb index 0e423301f8..7fd60d5553 100644 --- a/spec/ruby/core/random/rand_spec.rb +++ b/spec/ruby/core/random/rand_spec.rb @@ -49,18 +49,18 @@ describe "Random.rand" do end end -describe "Random#rand with Fixnum" do +describe "Random#rand with Integer" do it "returns an Integer" do - Random.new.rand(20).should be_an_instance_of(Fixnum) + Random.new.rand(20).should be_an_instance_of(Integer) end - it "returns a Fixnum greater than or equal to 0" do + it "returns an Integer greater than or equal to 0" do prng = Random.new ints = 20.times.map { prng.rand(5) } ints.min.should >= 0 end - it "returns a Fixnum less than the argument" do + it "returns an Integer less than the argument" do prng = Random.new ints = 20.times.map { prng.rand(5) } ints.max.should <= 4 @@ -92,19 +92,19 @@ describe "Random#rand with Fixnum" do end end -describe "Random#rand with Bignum" do - it "typically returns a Bignum" do +describe "Random#rand with Integer" do + it "typically returns an Integer" do rnd = Random.new(1) - 10.times.map{ rnd.rand(bignum_value*2) }.max.should be_an_instance_of(Bignum) + 10.times.map{ rnd.rand(bignum_value*2) }.max.should be_an_instance_of(Integer) end - it "returns a Bignum greater than or equal to 0" do + it "returns an Integer greater than or equal to 0" do prng = Random.new bigs = 20.times.map { prng.rand(bignum_value) } bigs.min.should >= 0 end - it "returns a Bignum less than the argument" do + it "returns an Integer less than the argument" do prng = Random.new bigs = 20.times.map { prng.rand(bignum_value) } bigs.max.should < bignum_value @@ -159,7 +159,7 @@ end describe "Random#rand with Range" do it "returns an element from the Range" do - Random.new.rand(20..43).should be_an_instance_of(Fixnum) + Random.new.rand(20..43).should be_an_instance_of(Integer) end it "supports custom object types" do -- cgit v1.2.3