class Cucumber::Runtime::AfterHooks
Public Class Methods
new(hooks, scenario)
click to toggle source
# File lib/cucumber/runtime/after_hooks.rb, line 5 def initialize(hooks, scenario) @hooks = hooks @scenario = scenario end
Public Instance Methods
apply_to(test_case)
click to toggle source
# File lib/cucumber/runtime/after_hooks.rb, line 10 def apply_to(test_case) test_case.with_steps( test_case.test_steps + after_hooks(test_case.source).reverse ) end
Private Instance Methods
after_hooks(source)
click to toggle source
# File lib/cucumber/runtime/after_hooks.rb, line 18 def after_hooks(source) @hooks.map do |hook| action = ->(result) { hook.invoke('After', @scenario.with_result(result)) } Hooks.after_hook(source, hook.location, &action) end end