Reputation: 267260
My rspec is failing, but both the expected and got values are identical.
It shows:
expected: 15.35
got: 15.35 (using ==)
Is this a datatype issue?
Upvotes: 1
Views: 224
Reputation: 3265
Well, this is probably just a float comparison issue. I think that the common solution is as suggested here: http://blog.daveastels.com/files/QuickRef.pdf
# Floating Point Comparison
object.should be_close <val>, <delta>
object.should_not be_close <val>, <delta>
Upvotes: 6