Class: Polyrun::Coverage::Formatter::JsonFormatter

Inherits:
Base
  • Object
show all
Defined in:
lib/polyrun/coverage/formatter.rb

Instance Method Summary collapse

Methods inherited from Base

#format, #initialize

Constructor Details

This class inherits a constructor from Polyrun::Coverage::Formatter::Base

Instance Method Details

#write_files(result, output_dir, basename) ⇒ Object



71
72
73
74
75
76
# File 'lib/polyrun/coverage/formatter.rb', line 71

def write_files(result, output_dir, basename)
  path = File.join(output_dir, "#{basename}.json")
  payload = Merge.to_simplecov_json(result.coverage_blob, meta: result.meta, groups: result.groups)
  File.write(path, JSON.generate(payload))
  {json: path}
end