I have just started using ScalaTest and I am using the following to compare two Doubles in my spec as follows:
it should \"calculate the price\" in { v
You can simply do actual shouldBe (expected +- tolerance) if using FlatSpec; other specs have similar matchers instead of shouldBe. It gives better messages in case of failures than assert, and the code is consistent with the other tests.
actual shouldBe (expected +- tolerance)
FlatSpec
shouldBe
assert