Array
An array of SimpleCov SourceFile instances with additional collection helper methods for calculating coverage across them etc.
Returns the count of lines that have coverage
# File lib/simplecov/file_list.rb, line 5 def covered_lines return 0.0 if empty? map {|f| f.covered_lines.count }.inject(&:+) end
Computes the coverage based upon lines covered and lines missed @return [Float]
# File lib/simplecov/file_list.rb, line 35 def covered_percent return 100.0 if empty? or lines_of_code == 0 Float(covered_lines * 100.0 / lines_of_code) end
Computes the strength (hits / line) based upon lines covered and lines missed @return [Float]
# File lib/simplecov/file_list.rb, line 42 def covered_strength return 0.0 if empty? or lines_of_code == 0 Float(map {|f| f.covered_strength * f.lines_of_code }.inject(&:+) / lines_of_code) end
Returns the overall amount of relevant lines of code across all files in this list
# File lib/simplecov/file_list.rb, line 29 def lines_of_code covered_lines + missed_lines end
Returns the count of lines that have been missed
# File lib/simplecov/file_list.rb, line 11 def missed_lines return 0.0 if empty? map {|f| f.missed_lines.count }.inject(&:+) end
Generated with the Darkfish Rdoc Generator 2.