Class: Testprune::DetectorResult
- Inherits:
-
Object
- Object
- Testprune::DetectorResult
- Defined in:
- lib/testprune/duplication_detector.rb
Overview
Holds the detection outcome and exposes the set that ‘apply` may patch. `ambient_units`/`setup_only` record what baseline subtraction removed, so the report can disclose it rather than silently dropping tests.
Instance Attribute Summary collapse
-
#ambient_units ⇒ Object
readonly
Returns the value of attribute ambient_units.
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
-
#footprints ⇒ Object
readonly
Returns the value of attribute footprints.
-
#setup_only ⇒ Object
readonly
Returns the value of attribute setup_only.
Instance Method Summary collapse
-
#approved_removals ⇒ Object
Only HIGH-confidence, non-review candidates that passed the safety check are auto-applicable.
-
#initialize(footprints, candidates, ambient_units: 0, setup_only: 0) ⇒ DetectorResult
constructor
A new instance of DetectorResult.
Constructor Details
#initialize(footprints, candidates, ambient_units: 0, setup_only: 0) ⇒ DetectorResult
Returns a new instance of DetectorResult.
25 26 27 28 29 30 |
# File 'lib/testprune/duplication_detector.rb', line 25 def initialize(footprints, candidates, ambient_units: 0, setup_only: 0) @footprints = footprints @candidates = candidates @ambient_units = ambient_units @setup_only = setup_only end |
Instance Attribute Details
#ambient_units ⇒ Object (readonly)
Returns the value of attribute ambient_units.
23 24 25 |
# File 'lib/testprune/duplication_detector.rb', line 23 def ambient_units @ambient_units end |
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates.
23 24 25 |
# File 'lib/testprune/duplication_detector.rb', line 23 def candidates @candidates end |
#footprints ⇒ Object (readonly)
Returns the value of attribute footprints.
23 24 25 |
# File 'lib/testprune/duplication_detector.rb', line 23 def footprints @footprints end |
#setup_only ⇒ Object (readonly)
Returns the value of attribute setup_only.
23 24 25 |
# File 'lib/testprune/duplication_detector.rb', line 23 def setup_only @setup_only end |
Instance Method Details
#approved_removals ⇒ Object
Only HIGH-confidence, non-review candidates that passed the safety check are auto-applicable. Structural (MEDIUM) and overlap (LOW) are review-only.
34 35 36 |
# File 'lib/testprune/duplication_detector.rb', line 34 def approved_removals @candidates.select { |c| c.confidence == :high && !c.review_only && c.safe } end |