class Cucumber::Formatter::AstLookup::TestCaseLookupBuilder

Attributes

lookup_hash[R]

Public Class Methods

new(gherkin_document) click to toggle source
# File lib/cucumber/formatter/ast_lookup.rb, line 70
def initialize(gherkin_document)
  @lookup_hash = {}
  process_scenario_container(gherkin_document.feature)
end

Private Instance Methods

process_scenario(child) click to toggle source
# File lib/cucumber/formatter/ast_lookup.rb, line 87
def process_scenario(child)
  if child.scenario.examples.empty?
    @lookup_hash[child.scenario.location.line] = ScenarioSource.new(:Scenario, child.scenario)
  else
    child.scenario.examples.each do |examples|
      examples.table_body.each do |row|
        @lookup_hash[row.location.line] = ScenarioOutlineSource.new(:ScenarioOutline, child.scenario, examples, row)
      end
    end
  end
end
process_scenario_container(container) click to toggle source
# File lib/cucumber/formatter/ast_lookup.rb, line 77
def process_scenario_container(container)
  container.children.each do |child|
    if child.respond_to?(:rule) && child.rule
      process_scenario_container(child.rule)
    elsif child.respond_to?(:scenario) && child.scenario
      process_scenario(child)
    end
  end
end