class Minitest::Reporters::HtmlReporter
def initialize(args = {})
:erb_template - the path to a custom ERB template, defaults to the supplied ERB template
:reports_dir - the directory the reports should be written to, defaults to 'test/html_reports'
:title - the title that will be used in the report, defaults to 'Test Results'
The constructor takes a hash, and uses the following keys:
def initialize(args = {}) super({}) defaults = { :title => 'Test Results', :erb_template => "#{File.dirname(__FILE__)}/../templates/index.html.erb", :reports_dir => 'test/html_reports', :mode => :safe } settings = defaults.merge(args) @mode = settings[:mode] @title = settings[:title] @erb_template = settings[:erb_template] reports_dir = settings[:reports_dir] @reports_path = File.absolute_path(reports_dir) puts "Emptying #{@reports_path}" FileUtils.remove_dir(@reports_path) if File.exists?(@reports_path) FileUtils.mkdir_p(@reports_path) end