Skip to content

Commit

Permalink
Fixed Kernel#rand spec
Browse files Browse the repository at this point in the history
Float should not be compared by identity.
  • Loading branch information
nobu authored and eregon committed Feb 27, 2021
1 parent 268fe33 commit 6e77f11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/kernel/rand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@

context "given an inclusive range between 0 and 1" do
it "returns an Integer between the two Integers" do
x = rand(0..1)
x.should be_kind_of(Integer)
(0..1).should include(x)
x = rand(0..1)
x.should be_kind_of(Integer)
(0..1).should include(x)
end

it "returns a Float if at least one side is Float" do
Expand All @@ -140,9 +140,9 @@

context "given an exclusive range between 0 and 1" do
it "returns zero as an Integer" do
x = rand(0...1)
x.should be_kind_of(Integer)
x.should eql(0)
x = rand(0...1)
x.should be_kind_of(Integer)
x.should eql(0)
end

it "returns a Float if at least one side is Float" do
Expand Down

0 comments on commit 6e77f11

Please sign in to comment.