Class: SimpleCov::Formatter::InlineHTMLFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov-inline-html.rb,
lib/simplecov-inline-html/version.rb

Constant Summary collapse

VERSION =
"0.0.1".freeze

Instance Method Summary collapse

Instance Method Details

#format(result) ⇒ Object



17
18
19
20
21
22
# File 'lib/simplecov-inline-html.rb', line 17

def format(result)
  File.open(File.join(output_path, "index.html"), "wb") do |file|
    file.puts template("layout").result(binding)
  end
  puts output_message(result)
end

#output_message(result) ⇒ Object



24
25
26
# File 'lib/simplecov-inline-html.rb', line 24

def output_message(result)
  "Coverage report generated for #{result.command_name} to #{output_path}. #{result.covered_lines} / #{result.total_lines} LOC (#{result.covered_percent.round(2)}%) covered."
end