Skip to content

Commit

Permalink
Merge pull request #175 from scotje/fix-rationals
Browse files Browse the repository at this point in the history
Makes SimpleCov resilient to inclusion of mathn library. (Re: #140)
  • Loading branch information
colszowka committed Nov 7, 2012
2 parents d4ed33b + d444f84 commit 9a391a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/simplecov/file_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/simplecov/source_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9a391a2

Please sign in to comment.