diff --git a/lib/simplecov/file_list.rb b/lib/simplecov/file_list.rb index 549070ba..21b3d75c 100644 --- a/lib/simplecov/file_list.rb +++ b/lib/simplecov/file_list.rb @@ -39,6 +39,6 @@ def covered_percent # Computes the strength (hits / line) based upon lines covered and lines missed def covered_strength return 0 if empty? or lines_of_code == 0 - map {|f| f.covered_strength }.inject(&:+) / size + map {|f| f.covered_strength }.inject(&:+).to_f / size end end diff --git a/lib/simplecov/source_file.rb b/lib/simplecov/source_file.rb index deb1998d..73d90cc7 100644 --- a/lib/simplecov/source_file.rb +++ b/lib/simplecov/source_file.rb @@ -114,7 +114,7 @@ def covered_percent if relevant_lines == 0 0 else - (covered_lines.count) * 100 / relevant_lines.to_f + (covered_lines.count) * 100.0 / relevant_lines.to_f end end