Class: Koality::SimpleCov::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/koality/simplecov/formatter.rb

Instance Method Summary collapse

Instance Method Details

#format(result) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/koality/simplecov/formatter.rb', line 8

def format(result)
  ::SimpleCov::Formatter::HTMLFormatter.new.format(result)

  Koality.options.ensure_output_directory_exists
  threshold_file = Koality.options.output_file(:code_coverage_file)

  File.open(threshold_file, "w") do |f|
    f << result.source_files.covered_percent.to_f
  end
end