Specs2 test:
val num1: Int = getNum1();
val num2: Int = getNum2();
math.abs(num2 - num1) must beLessThan(1000)
This may work, but is not elegant. Is there some better solution to do it?
Update:
I mean I want to find or create some matcher that I can write with:
num1 must beLessOrMoreThan(num2, 1000)
You can write
(num2 - num1) must beCloseTo(0 +/- 1000)