module SimpleCov::FormatResult

Module FormatResult uses JSON to dump the result to the configured output path

@author Mikael Henriksson <mikael@mhenrixon.com>

Public Class Methods

call(result, output_file_path) click to toggle source
# File lib/simple_cov/formatter/format_result.rb, line 10
def self.call(result, output_file_path)
  data = SimpleCov::Sublime::ResultToHash.new(result).to_h
  json = ::JSON.dump(data)

  File.open(output_file_path, 'w+') do |file|
    file.puts json
  end

  json
end