Skip to content

Commit

Permalink
don't use identity comparison on floats
Browse files Browse the repository at this point in the history
  • Loading branch information
ahorek authored and eregon committed Jan 28, 2021
1 parent 6a3c48b commit 5eae23f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/kernel/rand_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
x3 = Random.new(seed).rand(0.0..1)

x3.should be_kind_of(Float)
x1.should equal(x3)
x2.should equal(x3)
x1.should eql(x3)
x2.should eql(x3)

(0.0..1.0).should include(x3)
end
Expand All @@ -152,8 +152,8 @@
x3 = Random.new(seed).rand(0.0...1)

x3.should be_kind_of(Float)
x1.should equal(x3)
x2.should equal(x3)
x1.should eql(x3)
x2.should eql(x3)

(0.0...1.0).should include(x3)
end
Expand Down

0 comments on commit 5eae23f

Please sign in to comment.