aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/random
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-21 01:16:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-21 01:19:55 +0900
commit9c73c756244fa27ffa99d81dcc73a4ad14198002 (patch)
tree14b0ea9059b8c31e276531a1df712ead4e158cdb /spec/ruby/core/random
parentfb8f011422c645ebe29e94c3fb2079af73d1d35f (diff)
downloadruby-9c73c756244fa27ffa99d81dcc73a4ad14198002.tar.gz
Use Integer instead of Fixnum/Bignum
Diffstat (limited to 'spec/ruby/core/random')
-rw-r--r--spec/ruby/core/random/new_seed_spec.rb4
-rw-r--r--spec/ruby/core/random/new_spec.rb2
-rw-r--r--spec/ruby/core/random/rand_spec.rb20
3 files changed, 13 insertions, 13 deletions
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