Method: Minitest::Benchmark#validation_for_fit

Defined in:
lib/minitest/benchmark.rb

#validation_for_fit(msg, threshold) ⇒ Object

Returns a proc that calls the specified fit method and asserts that the error is within a tolerable threshold.



335
336
337
338
339
340
341
# File 'lib/minitest/benchmark.rb', line 335

def validation_for_fit msg, threshold
  proc do |range, times|
    a, b, rr = send "fit_#{msg}", range, times
    assert_operator rr, :>=, threshold
    [a, b, rr]
  end
end