Class: RSpecQ::Formatters::ExampleCountRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/rspecq/formatters/example_count_recorder.rb

Overview

Increments the example counter after each job.

Instance Method Summary collapse

Constructor Details

#initialize(queue) ⇒ ExampleCountRecorder

Returns a new instance of ExampleCountRecorder.



5
6
7
# File 'lib/rspecq/formatters/example_count_recorder.rb', line 5

def initialize(queue)
  @queue = queue
end

Instance Method Details

#dump_summary(summary) ⇒ Object



9
10
11
12
# File 'lib/rspecq/formatters/example_count_recorder.rb', line 9

def dump_summary(summary)
  n = summary.examples.count
  @queue.increment_example_count(n) if n > 0
end