Class: Rocha::Reporter::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/rocha/reporter/example_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#metadataObject (readonly)

Returns the value of attribute metadata.



8
9
10
# File 'lib/rocha/reporter/example_group.rb', line 8

def 
  @metadata
end

#parentObject (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_groupsObject 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