Nimble - expect to equal <0.9602>, got <0.9602>
Asked Answered
L

1

7

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?

Lingwood answered 4/10, 2016 at 13:29 Comment(0)
K
11

You should use beCloseTo instead of equal

More about it why here

Koontz answered 28/10, 2016 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.