Sha256: 9d98b5876bddb9a362571f4c8828dcc27ab43cdd229045f10654438dfba514cb

Contents?: true

Size: 1.18 KB

Versions: 15

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

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

      super(example)
    end

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

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

      super(example)
    end

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

      super(example)
    end

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

      super(example)
    end

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

      super(example)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rspec-tracer-1.0.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.9.3 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.9.2 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.9.1 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.9.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.8.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.7.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.6.2 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.6.1 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.6.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.5.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.4.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.3.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.2.0 lib/rspec_tracer/rspec_reporter.rb
rspec-tracer-0.1.0 lib/rspec_tracer/rspec_reporter.rb