Class: JobIteration::TestHelper::StoppingSupervisor

Inherits:
Object
  • Object
show all
Defined in:
lib/job-iteration/test_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(stop_after_count) ⇒ StoppingSupervisor

Returns a new instance of StoppingSupervisor.



7
8
9
10
# File 'lib/job-iteration/test_helper.rb', line 7

def initialize(stop_after_count)
  @stop_after_count = stop_after_count
  @calls = 0
end

Instance Method Details

#callObject



12
13
14
15
# File 'lib/job-iteration/test_helper.rb', line 12

def call
  @calls += 1
  (@calls % @stop_after_count) == 0
end