Module: RSpecTracer::RSpecReporter

Defined in:
lib/rspec_tracer/rspec_reporter.rb

Instance Method Summary collapse

Instance Method Details

#example_failed(example) ⇒ Object



29
30
31
32
33
34
# File 'lib/rspec_tracer/rspec_reporter.rb', line 29

def example_failed(example)
  example_id = example.[:rspec_tracer_example_id]
  RSpecTracer.runner.on_example_failed(example_id, example.execution_result)

  super(example)
end

#example_finished(example) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/rspec_tracer/rspec_reporter.rb', line 12

def example_finished(example)
  passed = example.execution_result.status == :passed
  RSpecTracer.stop_example_trace(passed) if RSpecTracer.trace_example?

  example_id = example.[:rspec_tracer_example_id]
  RSpecTracer.coverage_reporter.compute_diff(example_id)

  super(example)
end

#example_passed(example) ⇒ Object



22
23
24
25
26
27
# File 'lib/rspec_tracer/rspec_reporter.rb', line 22

def example_passed(example)
  example_id = example.[:rspec_tracer_example_id]
  RSpecTracer.runner.on_example_passed(example_id, example.execution_result)

  super(example)
end

#example_pending(example) ⇒ Object



36
37
38
39
40
41
# File 'lib/rspec_tracer/rspec_reporter.rb', line 36

def example_pending(example)
  example_id = example.[:rspec_tracer_example_id]
  RSpecTracer.runner.on_example_pending(example_id, example.execution_result)

  super(example)
end

#example_started(example) ⇒ Object



5
6
7
8
9
10
# File 'lib/rspec_tracer/rspec_reporter.rb', line 5

def example_started(example)
  RSpecTracer.coverage_reporter.record_coverage
  RSpecTracer.start_example_trace if RSpecTracer.trace_example?

  super(example)
end