Sha256: 6bd43ebe5cbdcee1e0e3e563e74e357ee3ac9b53875e1b78c1623f7d05e84714
Contents?: true
Size: 899 Bytes
Versions: 4
Compression:
Stored size: 899 Bytes
Contents
module Teabag class Coverage include Teabag::Utility def initialize(data) @data = data end def reports Dir.mktmpdir do |path| input = File.join(path, 'coverage.json') File.write(input, @data.to_json) results = [] for format in Teabag.configuration.coverage_reports result = generate_report(input, format) results << result if ["text", "text-summary"].include?(format.to_s) end "\n#{results.join("\n\n")}\n" end end private def generate_report(input, format) result = %x{#{executable} report #{format} #{input.shellescape}} raise "Could not generate coverage report for #{format}" unless $?.exitstatus == 0 result.gsub("Done", "").gsub("Using reporter [#{format}]", "").strip end def executable @executable ||= which("istanbul") end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
teabag-0.7.2 | lib/teabag/coverage.rb |
teabag-0.7.1 | lib/teabag/coverage.rb |
teabag-0.7.0 | lib/teabag/coverage.rb |
teabag-0.6.0 | lib/teabag/coverage.rb |