Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 663
Aleš Oskar Kocur Avatar asked Oct 04 '16 13:10

Aleš Oskar Kocur


1 Answers

You should use beCloseTo instead of equal

More about it why here

like image 121
Błażej Avatar answered Nov 03 '22 04:11

Błażej