Fix math in reporters

This commit is contained in:
Markus Schirp 2013-06-22 00:23:03 +02:00
parent 9b5deb779b
commit 3ae411bb7f
2 changed files with 5 additions and 2 deletions

View file

@ -151,7 +151,8 @@ module Mutant
# @api private
#
def coverage
amount_kills / amount_mutations * 100
return 0 if amount_mutations.zero?
Rational(amount_kills, amount_mutations) * 100
end
# Return amount of alive mutations

View file

@ -64,6 +64,7 @@ module Mutant
# @api private
#
def print_stats
p coverage
status('(%02d/%02d) %3d%% - %0.02fs', amount_kills, amount_mutations, coverage, time)
end
@ -116,7 +117,8 @@ module Mutant
# @api private
#
def coverage
coverage = amount_kills.to_f / amount_mutations * 100
return 0 if amount_mutations.zero?
Rational(amount_kills, amount_mutations) * 100
end
# Detailed subject printer