swifttestingquick-nimble

Nimble - expect to equal <0.9602>, got <0.9602>


My project is written in Swift 2.0 and I use Quick & Nimble to test my code.

expect(workerSpy.buySharesQuantity).to(equal(0.9602))

What I get is expectation failure with error message

expected to equal <0.9602>, got <0.9602>

Definition of buySharesQuantity

var buySharesQuantity: Double = 0.0

Does anyone have an idea why?


Solution

  • You should use beCloseTo instead of equal

    More about it why here