Class: Cucumber::Runtime::BeforeHooks

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/runtime/before_hooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(hooks, scenario) ⇒ BeforeHooks

Returns a new instance of BeforeHooks.



6
7
8
9
# File 'lib/cucumber/runtime/before_hooks.rb', line 6

def initialize(hooks, scenario)
  @hooks = hooks
  @scenario = scenario
end

Instance Method Details

#apply_to(test_case) ⇒ Object



11
12
13
14
15
# File 'lib/cucumber/runtime/before_hooks.rb', line 11

def apply_to(test_case)
  test_case.with_steps(
    before_hooks(test_case.source) + test_case.test_steps
  )
end