Class: Lucid::Parser::SpecBuilder::FeatureBuilder

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



153
154
155
# File 'lib/lucid/spec_builder.rb', line 153

def add_child(child)
  children << child
end

#background_builder=(builder) ⇒ Object



149
150
151
# File 'lib/lucid/spec_builder.rb', line 149

def background_builder=(builder)
  @background_builder = builder
end

#childrenObject



157
158
159
# File 'lib/lucid/spec_builder.rb', line 157

def children
  @children ||= []
end

#result(language) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/lucid/spec_builder.rb', line 132

def result(language)
  background = background(language)
  feature = Lucid::AST::Feature.new(
    location,
    background,
    comment,
    tags,
    node.keyword,
    node.name.lstrip,
    node.description.rstrip,
    children.map { |builder| builder.result(background, language, tags) }
  )
  feature.gherkin_statement(node)
  feature.language = language
  feature
end