Module: RSpecTracer::Example

Defined in:
lib/rspec_tracer/example.rb

Class Method Summary collapse

Class Method Details

.from(example) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rspec_tracer/example.rb', line 7

def from(example)
  data = {
    example_group: example.example_group.name,
    description: example.description,
    full_description: example.full_description,
    shared_group: example.[:shared_group_inclusion_backtrace]
      .map(&:formatted_inclusion_location)
  }.merge(example_location(example))

  data.merge(example_id: Digest::MD5.hexdigest(data.to_json))
end