module Minitest

Public Class Methods

plugin_failure_reporter_init(options) click to toggle source
# File lib/minitest/failure_reporter_plugin.rb, line 15
def self.plugin_failure_reporter_init(options)
  return unless options.delete :failure_reporter
  file_klass = options.delete(:file_klass) || File
  filename = options.delete(:failure_reporter_filename) || 'failure_file.json'
  io = file_klass.new(filename, 'w')
  reporter << FailureReporter::Reporter.new(io, options)
end
plugin_failure_reporter_options(opts, options) click to toggle source
# File lib/minitest/failure_reporter_plugin.rb, line 5
def self.plugin_failure_reporter_options(opts, options)
  opts.on '--failure-reporter', 'Generate a failure json report' do
    options[:failure_reporter] = true
  end
  opts.on '--failure-reporter-filename=OUT', 'Target output filename.'\
                                  ' Defaults to failure_file.json' do |out|
    options[:failure_reporter_filename] = out
  end
end