Skip to content

Commit 7ea2082

Browse files
committed
Define a constant for tolerance with time comparisons
1 parent 2ee81e7 commit 7ea2082

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/mspec/lib/mspec/matchers/be_close.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
TOLERANCE = 0.00003 unless Object.const_defined?(:TOLERANCE)
2+
# To account for GC, context switches, other processes, load, etc.
3+
TIME_TOLERANCE = 20.0 unless Object.const_defined?(:TIME_TOLERANCE)
24

35
class BeCloseMatcher
46
def initialize(expected, tolerance)

0 commit comments

Comments
 (0)