Class: ParallelCucumber::Hooks

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel_cucumber/hooks.rb

Class Method Summary collapse

Class Method Details

.fire_after_batch_hooks(*args) ⇒ Object



23
24
25
26
27
# File 'lib/parallel_cucumber/hooks.rb', line 23

def fire_after_batch_hooks(*args)
  @after_batch_hooks.each do |hook|
    hook.call(*args)
  end
end

.fire_before_batch_hooks(*args) ⇒ Object



17
18
19
20
21
# File 'lib/parallel_cucumber/hooks.rb', line 17

def fire_before_batch_hooks(*args)
  @before_batch_hooks.each do |hook|
    hook.call(*args)
  end
end

.register_after_batch(proc) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
# File 'lib/parallel_cucumber/hooks.rb', line 12

def register_after_batch(proc)
  raise(ArgumentError, 'Please provide a valid callback') unless proc.respond_to?(:call)
  @after_batch_hooks << proc
end

.register_before_batch(proc) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
# File 'lib/parallel_cucumber/hooks.rb', line 7

def register_before_batch(proc)
  raise(ArgumentError, 'Please provide a valid callback') unless proc.respond_to?(:call)
  @before_batch_hooks << proc
end