Class: Lucid::Parser::TDLBuilder::ScenarioBuilder

Inherits:
Builder 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



216
217
218
# File 'lib/lucid/tdl_builder.rb', line 216

def add_child(child)
  children << child
end

#childrenObject



220
221
222
# File 'lib/lucid/tdl_builder.rb', line 220

def children
  @children ||= []
end

#result(background, language, feature_tags) ⇒ Object



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/lucid/tdl_builder.rb', line 195

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



212
213
214
# File 'lib/lucid/tdl_builder.rb', line 212

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