Class: CucumberAnalytics::TestElement
- Inherits:
-
FeatureElement
- Object
- FeatureElement
- CucumberAnalytics::TestElement
- Includes:
- Containing
- Defined in:
- lib/cucumber_analytics/test_element.rb
Overview
A class modeling an element that contains steps.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#steps ⇒ Object
The steps contained by the 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
-
#==(other_element) ⇒ Object
Returns true if the two elements have equivalent steps and false otherwise.
-
#contains ⇒ Object
Returns the immediate child elements of the element.
-
#initialize(parsed_test_element = nil) ⇒ TestElement
constructor
Creates a new TestElement object and, if parsed_test_element is provided, populates the object.
Methods included from Nested
Constructor Details
#initialize(parsed_test_element = nil) ⇒ TestElement
Creates a new TestElement object and, if parsed_test_element is provided, populates the object.
16 17 18 19 20 21 22 |
# File 'lib/cucumber_analytics/test_element.rb', line 16 def initialize(parsed_test_element = nil) super @steps = [] build_test_element(parsed_test_element) if parsed_test_element end |
Instance Attribute Details
#steps ⇒ Object
The steps contained by the TestElement
11 12 13 |
# File 'lib/cucumber_analytics/test_element.rb', line 11 def steps @steps end |
Instance Method Details
#==(other_element) ⇒ Object
Returns true if the two elements have equivalent steps and false otherwise.
25 26 27 28 29 |
# File 'lib/cucumber_analytics/test_element.rb', line 25 def ==(other_element) return false unless other_element.respond_to?(:steps) steps == other_element.steps end |
#contains ⇒ Object
Returns the immediate child elements of the element.
32 33 34 |
# File 'lib/cucumber_analytics/test_element.rb', line 32 def contains @steps end |