Class: SixthSense::Reporters::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/sixth_sense/reporters/markdown.rb

Instance Method Summary collapse

Instance Method Details

#render(reports) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sixth_sense/reporters/markdown.rb', line 6

def render(reports)
  lines = ["| Test file | Adequacy | Redundancy | Quality | Composite |", "|---|---:|---:|---:|---:|"]
  reports.each do |report|
    axes = report.axis_scores.to_h { |score| [score.axis, score] }
    lines << [
      report.test_file.path,
      score_cell(axes[:adequacy]),
      score_cell(axes[:redundancy]),
      score_cell(axes[:quality]),
      numeric(report.composite)
    ].join(" | ").prepend("| ").concat(" |")
  end
  lines.join("\n")
end