6

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?

Aleš Oskar Kocur
  • 1,381
  • 1
  • 13
  • 29

1 Answers1

9

You should use beCloseTo instead of equal

More about it why here

Błażej
  • 3,617
  • 7
  • 35
  • 62