Class: Lucid::Parser::TDLBuilder::ScenarioOutlineBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/lucid/tdl_builder.rb

Instance Method Summary collapse

Methods inherited from Builder

#initialize

Constructor Details

This class inherits a constructor from Lucid::Parser::TDLBuilder::Builder

Instance Method Details

#add_child(child) ⇒ Object



253
254
255
# File 'lib/lucid/tdl_builder.rb', line 253

def add_child(child)
  children << child
end

#add_examples(examples_section, node) ⇒ Object



244
245
246
247
# File 'lib/lucid/tdl_builder.rb', line 244

def add_examples(examples_section, node)
  @examples_sections ||= []
  @examples_sections << [examples_section, node]
end

#childrenObject



257
258
259
# File 'lib/lucid/tdl_builder.rb', line 257

def children
  @children ||= []
end

#result(background, language, feature_tags) ⇒ Object



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/lucid/tdl_builder.rb', line 226

def result(background, language, feature_tags)
  scenario_outline = AST::ScenarioOutline.new(
    language,
    location,
    background,
    comment,
    tags,
    feature_tags,
    node.keyword,
    node.name,
    node.description,
    steps(language),
    examples_sections
  )
  scenario_outline.gherkin_statement(node)
  scenario_outline
end

#steps(language) ⇒ Object



249
250
251
# File 'lib/lucid/tdl_builder.rb', line 249

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