Module: Henitai::Integration::CoverageRuntimeSuppressors
- Defined in:
- lib/henitai/integration/coverage_suppression.rb
Overview
Suppresses expensive and irrelevant coverage startup/teardown during mutant child runs. Coverage artifacts are only required during the dedicated bootstrap phase.
Class Method Summary collapse
Class Method Details
.suppress_coverage! ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/henitai/integration/coverage_suppression.rb', line 32 def self.suppress_coverage! require "coverage" cov = Object.const_get(:Coverage) # steep:ignore Ruby::UnknownConstant return if cov.singleton_class.ancestors.include?(CoverageStartSuppressor) cov.singleton_class.prepend(CoverageStartSuppressor) rescue LoadError, NameError nil end |
.suppress_simplecov! ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/henitai/integration/coverage_suppression.rb', line 21 def self.suppress_simplecov! require "simplecov" sc = Object.const_get(:SimpleCov) # steep:ignore Ruby::UnknownConstant sc.external_at_exit = true if sc.respond_to?(:external_at_exit=) return if sc.singleton_class.ancestors.include?(SimpleCovStartSuppressor) sc.singleton_class.prepend(SimpleCovStartSuppressor) rescue LoadError, NameError nil end |