Class: Rocha::Reporter::ExampleGroup
- Inherits:
-
Object
- Object
- Rocha::Reporter::ExampleGroup
- Defined in:
- lib/rocha/reporter/example_group.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(data, parent) ⇒ ExampleGroup
constructor
A new instance of ExampleGroup.
- #parent_groups ⇒ Object (also: #ancestors)
- #update_metadata(data) ⇒ Object
Constructor Details
#initialize(data, parent) ⇒ ExampleGroup
Returns a new instance of ExampleGroup.
10 11 12 13 |
# File 'lib/rocha/reporter/example_group.rb', line 10 def initialize(data, parent) @metadata = Metadata.new(data) @parent = parent end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/rocha/reporter/example_group.rb', line 8 def @metadata end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
8 9 10 |
# File 'lib/rocha/reporter/example_group.rb', line 8 def parent @parent end |
Instance Method Details
#parent_groups ⇒ Object Also known as: ancestors
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rocha/reporter/example_group.rb', line 19 def parent_groups ancestor = parent groups = [] while ancestor groups << ancestor ancestor = ancestor.parent end groups end |
#update_metadata(data) ⇒ Object
32 33 34 |
# File 'lib/rocha/reporter/example_group.rb', line 32 def (data) .update(data) end |