Sha256: 3a51eb79dfcdd94185e48660572ff5b3bd99ab761c5a7fa04a23d0282082dc33

Contents?: true

Size: 551 Bytes

Versions: 1

Compression:

Stored size: 551 Bytes

Contents

require "simplecov-markdown/version"

class SimpleCov::Formatter::MarkdownFormatter
  def format(result)
    @report = File.open(SimpleCov::Formatter::MarkdownFormatter.output_path, 'w')
    @report.puts "Code Coverage Report"
    @report.puts "======================\n\n"
    @report.puts "|File|Coverage|"
    @report.puts "|:--|--:|"
    result.files.each do |file|
      @report.puts "|#{file.filename}|#{file.covered_percent}%|"
    end
    @report.close
  end
  def self.output_path
    File.join(SimpleCov.coverage_path, 'report.md')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simplecov-markdown-0.1.0 lib/simplecov-markdown.rb