Sha256: a268469cdcf647ceb84c6020426df41a0fc1623e93881b937e83c5300da060f9

Contents?: true

Size: 532 Bytes

Versions: 1

Compression:

Stored size: 532 Bytes

Contents

def assert_timings(reports, metrics, times, delta=30)
  if Object.const_defined?('RSpec')
    expect(reports.count).to eq metrics.count
    metrics.zip(times).each_with_index do |(m,v), i|
      expect(reports[i][:timing]).to eq m
      expect(reports[i][:val]).to(be_within(delta).of(v)) if v >=0
    end
  else
    assert_equal reports.count, metrics.count
    metrics.zip(times).each_with_index do |(m,v), i|
      assert_equal reports[i][:timing], m
      assert_in_delta(reports[i][:val], v, delta) if v >=0
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vitals-0.4.0 integration/multiverse_helper.rb