Class: Lucid::Parser::SpecBuilder::ScenarioOutlineBuilder

Inherits:
Spec
  • Object
show all
Defined in:
lib/lucid/spec_builder.rb

Instance Method Summary collapse

Methods inherited from Spec

#initialize

Constructor Details

This class inherits a constructor from Lucid::Parser::SpecBuilder::Spec

Instance Method Details

#add_child(child) ⇒ Object



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

def add_child(child)
  children << child
end

#add_examples(examples_section, node) ⇒ Object



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

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

#childrenObject



261
262
263
# File 'lib/lucid/spec_builder.rb', line 261

def children
  @children ||= []
end

#result(background, language, feature_tags) ⇒ Object



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/lucid/spec_builder.rb', line 230

def result(background, language, feature_tags)
  scenario_outline = Lucid::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



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

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