class SimpleCov::Formatter::JSONFormatter

Public Instance Methods

format(result) click to toggle source
# File lib/simplecov_json_formatter.rb, line 10
def format(result)
  result_hash = format_result(result)

  export_formatted_result(result_hash)

  puts output_message(result)
end

Private Instance Methods

export_formatted_result(result_hash) click to toggle source
# File lib/simplecov_json_formatter.rb, line 25
def export_formatted_result(result_hash)
  result_exporter = SimpleCovJSONFormatter::ResultExporter.new(result_hash)
  result_exporter.export
end
format_result(result) click to toggle source
# File lib/simplecov_json_formatter.rb, line 20
def format_result(result)
  result_hash_formater = SimpleCovJSONFormatter::ResultHashFormatter.new(result)
  result_hash_formater.format
end
output_message(result) click to toggle source
# File lib/simplecov_json_formatter.rb, line 30
def output_message(result)
  "JSON Coverage report generated for #{result.command_name} to #{SimpleCov.coverage_path}. \
  #{result.covered_lines} / #{result.total_lines} LOC (#{result.covered_percent.round(2)}%) covered."
end