Class: Cucumber::Parser::GherkinBuilder::ScenarioBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/cucumber/parser/gherkin_builder.rb

Instance Method Summary collapse

Methods inherited from Builder

#initialize

Constructor Details

This class inherits a constructor from Cucumber::Parser::GherkinBuilder::Builder

Instance Method Details

#add_child(child) ⇒ Object



218
219
220
# File 'lib/cucumber/parser/gherkin_builder.rb', line 218

def add_child(child)
  children << child
end

#childrenObject



222
223
224
# File 'lib/cucumber/parser/gherkin_builder.rb', line 222

def children
  @children ||= []
end

#result(background, language, feature_tags) ⇒ Object



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/cucumber/parser/gherkin_builder.rb', line 197

def result(background, language, feature_tags)
  scenario = Ast::Scenario.new(
    language,
    location,
    background,
    comment,
    tags,
    feature_tags,
    node.keyword,
    node.name,
    node.description,
    steps(language)
  )
  scenario.gherkin_statement(node)
  scenario
end

#steps(language) ⇒ Object



214
215
216
# File 'lib/cucumber/parser/gherkin_builder.rb', line 214

def steps(language)
  children.map { |child| child.result(language) }
end