class MarkdownSummary
Definitions
def call(wrapper, output = $stdout)
A coverage array gives, for each line, the number of line execution by the interpreter. A nil value means coverage is finishd for this line (lines like else and end).
Implementation
def call(wrapper, output = $stdout)
output.puts "# Coverage Report"
output.puts
ordered = []
buffer = StringIO.new
statistics = self.each(wrapper) do |coverage|
ordered << coverage unless coverage.complete?
end
statistics.print(output)
if ordered.any?
output.puts "", "\#\# Least Coverage:", ""
ordered.sort_by!(&:missing_count).reverse!
ordered.first(5).each do |coverage|
path = wrapper.relative_path(coverage.path)
output.puts "- `#{path}`: #{coverage.missing_count} lines not executed!"
end
end
output.print(buffer.string)
end