Module: RSpecTracer::Reporters::CoverageJsonReporter::SimpleCovInterop Private

Defined in:
lib/rspec_tracer/reporters/coverage_json_reporter.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Inner module preserving 1.x’s RubyCoverage shim contract. When SimpleCov calls ‘::Coverage.result` at its at_exit time, this prepended `result` method returns rspec-tracer’s filtered cumulative coverage so SimpleCov’s result-merge sees exactly what rspec-tracer saw. Matches the 1.x behavior the integration matrix relies on.

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.coverageObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Internal attribute.



319
320
321
# File 'lib/rspec_tracer/reporters/coverage_json_reporter.rb', line 319

def coverage
  @coverage
end

Class Method Details

.install(coverage) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Internal helper for the tracer pipeline.



324
325
326
327
328
# File 'lib/rspec_tracer/reporters/coverage_json_reporter.rb', line 324

def self.install(coverage)
  self.coverage = coverage
  klass = ::Coverage.singleton_class
  klass.prepend(self) unless klass.ancestors.include?(self)
end

Instance Method Details

#resultObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Internal method on the tracer pipeline.



332
333
334
# File 'lib/rspec_tracer/reporters/coverage_json_reporter.rb', line 332

def result
  SimpleCovInterop.coverage
end