Module: CukeProfiles::CucumberHelper

Defined in:
lib/cuke_profiles/cucumber_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_profile(scenario) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/cuke_profiles/cucumber_helper.rb', line 3

def current_profile(scenario)
  if scenario.is_a? Cucumber::Ast::Scenario
    scenario.feature.file
  elsif scenario.is_a? Cucumber::Ast::OutlineTable::ExampleRow
    scenario.scenario_outline.feature.file
  else
    raise "Can't deal with #{scenario.class.name}"
  end[/profiles\/(.+?)\//, 1]
end