Method: Tapout::Reporters::Abstract#time_tally

Defined in:
lib/tapout/reporters/abstract.rb

#time_tally(entry) ⇒ Array<Float>

Calculate the lapsed time, the rate of testing and average time per test.

Returns:

  • (Array<Float>)

    Lapsed time, rate and average.



185
186
187
188
189
190
191
192
193
194
# File 'lib/tapout/reporters/abstract.rb', line 185

def time_tally(entry)
  total = @passed.size + @failed.size + @raised.size + @skipped.size + @omitted.size
  total = entry['counts']['total'] || total

  time = (entry['time'] || (Time.now - @start_time)).to_f
  rate = total / time
  avg  = time / total

  return time, rate, avg
end