Class: CucumberAnalytics::Outline
- Inherits:
-
TestElement
- Object
- FeatureElement
- TestElement
- CucumberAnalytics::Outline
- Includes:
- Taggable
- Defined in:
- lib/cucumber_analytics/outline.rb
Overview
A class modeling a Cucumber Scenario Outline.
Instance Attribute Summary collapse
-
#examples ⇒ Object
The Example objects contained by the Outline.
Attributes included from Taggable
Attributes inherited from TestElement
Attributes inherited from FeatureElement
#description, #description_text, #name
Attributes included from Nested
Attributes included from Raw
Attributes included from Sourceable
Instance Method Summary collapse
-
#contains ⇒ Object
Returns the immediate child elements of the outline (i.e. its Example objects..
-
#initialize(source = nil) ⇒ Outline
constructor
Creates a new Outline object and, if source is provided, populates the object.
-
#to_s ⇒ Object
Returns a gherkin representation of the outline.
Methods included from Taggable
#all_tag_elements, #all_tags, #applied_tag_elements, #applied_tags
Methods inherited from TestElement
Methods included from Nested
Constructor Details
#initialize(source = nil) ⇒ Outline
Creates a new Outline object and, if source is provided, populates the object.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cucumber_analytics/outline.rb', line 16 def initialize(source = nil) parsed_outline = process_source(source) super(parsed_outline) @tags = [] @tag_elements = [] @examples = [] build_outline(parsed_outline) if parsed_outline end |
Instance Attribute Details
#examples ⇒ Object
The Example objects contained by the Outline
11 12 13 |
# File 'lib/cucumber_analytics/outline.rb', line 11 def examples @examples end |
Instance Method Details
#contains ⇒ Object
Returns the immediate child elements of the outline (i.e. its Example objects.
30 31 32 |
# File 'lib/cucumber_analytics/outline.rb', line 30 def contains @examples + @steps end |
#to_s ⇒ Object
Returns a gherkin representation of the outline.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cucumber_analytics/outline.rb', line 35 def to_s text = '' text << tag_output_string + "\n" unless .empty? text << "Scenario Outline:#{name_output_string}" text << "\n" + description_output_string unless description_text.empty? text << "\n" unless steps.empty? || description_text.empty? text << "\n" + steps_output_string unless steps.empty? text << "\n\n" + examples_output_string unless examples.empty? text end |