Class: Turnip::Node::Feature
- Inherits:
-
ScenarioGroupDefinition
- Object
- Base
- ScenarioGroupDefinition
- Turnip::Node::Feature
- Includes:
- HasTags
- Defined in:
- lib/turnip/node/feature.rb
Overview
Note:
Feature metadata generated by Gherkin
{
type: :Feature,
tags: [], # Array of Tag
location: { line: 10, column: 3 },
language: 'en',
keyword: 'Feature',
name: 'Feature name',
description: 'Feature description',
children: [], # Array of Background, Scenario and Scenario Outline
}
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from HasTags
Methods inherited from ScenarioGroupDefinition
#backgrounds, #description, #keyword, #name, #scenarios
Methods inherited from Base
Methods included from HasLocation
Constructor Details
This class inherits a constructor from Turnip::Node::Base
Instance Method Details
#children ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/turnip/node/feature.rb', line 29 def children @children ||= @raw.children.map do |child| if child.is_a?(CukeModeler::Background) next Background.new(child) end if child.is_a?(CukeModeler::Scenario) next Scenario.new(child) end if child.is_a?(CukeModeler::Outline) next ScenarioOutline.new(child) end if child.is_a?(CukeModeler::Rule) next Rule.new(child) end end.compact end |
#language ⇒ Object
25 26 27 |
# File 'lib/turnip/node/feature.rb', line 25 def language @raw.language end |
#metadata_hash ⇒ Object
55 56 57 |
# File 'lib/turnip/node/feature.rb', line 55 def super.merge(:type => Turnip.type, :turnip => true) end |
#rules ⇒ Object
49 50 51 52 53 |
# File 'lib/turnip/node/feature.rb', line 49 def rules @rules ||= children.select do |c| c.is_a?(Rule) end end |