Class: Cucumber::Filters::PrepareWorld::CaseFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/filters/prepare_world.rb

Instance Method Summary collapse

Constructor Details

#initialize(runtime, original_test_case) ⇒ CaseFilter

Returns a new instance of CaseFilter.



15
16
17
18
# File 'lib/cucumber/filters/prepare_world.rb', line 15

def initialize(runtime, original_test_case)
  @runtime = runtime
  @original_test_case = original_test_case
end

Instance Method Details

#test_caseObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/cucumber/filters/prepare_world.rb', line 20

def test_case
  init_scenario = Cucumber::Hooks.around_hook do |continue|
    @runtime.begin_scenario(scenario)
    continue.call
    @runtime.end_scenario(scenario)
  end
  around_hooks = [init_scenario] + @original_test_case.around_hooks

  @original_test_case.with_around_hooks(around_hooks).with_steps(@original_test_case.test_steps)
end