Module: Evilution::Compare::Detector Private
- Defined in:
- lib/evilution/compare/detector.rb
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.
Class Method Summary collapse
- .call(json) ⇒ Object private
Class Method Details
.call(json) ⇒ 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.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/evilution/compare/detector.rb', line 9 def call(json) raise Evilution::Compare::InvalidInput, "expected Hash, got #{json.class}" unless json.is_a?(Hash) mutant = json.key?("subject_results") evilution = json.key?("summary") && Evilution::Compare::Normalizer::EVILUTION_BUCKETS.any? { |k| json.key?(k) } raise Evilution::Compare::InvalidInput, "ambiguous JSON shape - both mutant and evilution markers present" if mutant && evilution return :mutant if mutant return :evilution if evilution raise Evilution::Compare::InvalidInput, "cannot detect tool from JSON shape" end |