class Crispr::Reporter
Reporter collects mutation testing results and prints a summary.
def initialize
def initialize @killed = 0 @survived = 0 end
def record(killed:)
-
(void)
-
Parameters:
-
killed
(Boolean
) -- whether the mutation was killed
def record(killed:) killed ? @killed += 1 : @survived += 1 end
def score
-
(Float)
- the mutation score
def score total = @killed + @survived total.zero? ? 0.0 : (@killed.to_f / total * 100).round(2) end
def summary
-
(Hash)
- summary statistics including totals and score
def summary total = @killed + @survived { mutations: total, killed: @killed, survived: @survived, score: score } end