lib/minitest/reporters/html_reporter.rb in minitest-reporters-1.1.7 vs lib/minitest/reporters/html_reporter.rb in minitest-reporters-1.1.8

- old
+ new

@@ -73,21 +73,20 @@ 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) + File.delete(html_file) end # Called by the framework to generate the report def report super begin puts "Writing HTML reports to #{@reports_path}" - html_file = "#{@reports_path}/#{@output_filename}" erb_str = File.read(@erb_template) renderer = ERB.new(erb_str) tests_by_suites = tests.group_by(&:class) # taken from the JUnit reporter @@ -113,9 +112,12 @@ end end private + def html_file + "#{@reports_path}/#{@output_filename}" + end def compare_suites_by_name(suite_a, suite_b) suite_a[:name] <=> suite_b[:name] end