Permalink
Browse files

add some other needed methods

  • Loading branch information...
1 parent 3d463dd commit 466446acf47079cfc45d4af84380951278c35cfa @cap10morgan cap10morgan committed Feb 10, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/simplecov-rcov.rb
View
10 lib/simplecov-rcov.rb
@@ -24,6 +24,16 @@ def format( result )
private
+ def lines_covered(file_list)
+ return 0.0 if file_list.length == 0
+ file_list.map {|f| f.covered_lines.count }.inject(&:+)
+ end
+
+ def lines_missed(file_list)
+ return 0.0 if file_list.length == 0
+ file_list.map {|f| f.missed_lines.count }.inject(&:+)
+ end
+
def lines_of_code(file_list)
lines_missed(file_list) + lines_covered(file_list)
end

0 comments on commit 466446a

Please sign in to comment.