Module: SimpleCov::Formatter::Console::BlockOutput
- Defined in:
- lib/simplecov-console/output/block.rb
Instance Method Summary collapse
-
#output(files, root) ⇒ Object
format per-file results output as plain text blocks.
Instance Method Details
#output(files, root) ⇒ Object
format per-file results output as plain text blocks
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/simplecov-console/output/block.rb', line 6 def output(files, root) blocks = [] files.each do |f| block = [] block << sprintf("%8.8s: %s", 'file', f.filename.gsub(root + "/", '')) block << sprintf("%8.8s: %s (%d/%d lines)", 'coverage', colorize(sprintf("%.2f%%", f.covered_percent)), f.covered_lines.count, f.lines_of_code) block << sprintf("%8.8s: %s", 'missed', missed(f.missed_lines).join(", ")) blocks << block.join("\n") end "\n" + blocks.join("\n\n") + "\n\n" end |