lib/undercover/lcov_parser.rb in undercover-0.3.3 vs lib/undercover/lcov_parser.rb in undercover-0.3.4
- old
+ new
@@ -20,9 +20,16 @@
io.each(&method(:parse_line))
io.close
self
end
+ def coverage(filepath)
+ _filename, coverage = source_files.find do |relative_path, _|
+ relative_path == filepath
+ end
+ coverage || []
+ end
+
private
# rubocop:disable Metrics/MethodLength, Style/SpecialGlobalVars
def parse_line(line)
case line