class Cucumber::Runtime::StepHooks
Public Class Methods
new(hooks)
click to toggle source
# File lib/cucumber/runtime/step_hooks.rb, line 4 def initialize(hooks) @hooks = hooks end
Public Instance Methods
apply(test_steps)
click to toggle source
# File lib/cucumber/runtime/step_hooks.rb, line 8 def apply(test_steps) test_steps.flat_map do |test_step| [test_step] + after_step_hooks(test_step) end end
Private Instance Methods
after_step_hooks(test_step)
click to toggle source
# File lib/cucumber/runtime/step_hooks.rb, line 15 def after_step_hooks(test_step) @hooks.map do |hook| action = ->(*args) { hook.invoke('AfterStep', args) } Hooks.after_step_hook(test_step.source, hook.location, &action) end end