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



41
42
43
44
45
# File 'lib/parallel_cucumber/hooks.rb', line 41

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

.fire_after_workers(*args) ⇒ Object



53
54
55
56
57
# File 'lib/parallel_cucumber/hooks.rb', line 53

def fire_after_workers(*args)
  @after_workers.each do |hook|
    hook.call(*args)
  end
end

.fire_before_batch_hooks(*args) ⇒ Object



35
36
37
38
39
# File 'lib/parallel_cucumber/hooks.rb', line 35

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

.fire_before_workers(*args) ⇒ Object



47
48
49
50
51
# File 'lib/parallel_cucumber/hooks.rb', line 47

def fire_before_workers(*args)
  @before_workers.each do |hook|
    hook.call(*args)
  end
end

.fire_on_batch_error(*args) ⇒ Object



59
60
61
62
63
# File 'lib/parallel_cucumber/hooks.rb', line 59

def fire_on_batch_error(*args)
  @on_batch_error.each do |hook|
    hook.call(*args)
  end
end

.register_after_batch(proc) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
# File 'lib/parallel_cucumber/hooks.rb', line 15

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

.register_after_workers(proc) ⇒ Object

Raises:

  • (ArgumentError)


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

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

.register_before_batch(proc) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
# File 'lib/parallel_cucumber/hooks.rb', line 10

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

.register_before_workers(proc) ⇒ Object

Raises:

  • (ArgumentError)


20
21
22
23
# File 'lib/parallel_cucumber/hooks.rb', line 20

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

.register_on_batch_error(proc) ⇒ Object

Raises:

  • (ArgumentError)


30
31
32
33
# File 'lib/parallel_cucumber/hooks.rb', line 30

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