Method: MiniTest::Unit::TestCase#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.


287
288
289
290
291
292
293
# File 'lib/minitest/benchmark.rb', line 287

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