lib/minitest/junit.rb in minitest-junit-2.0.0 vs lib/minitest/junit.rb in minitest-junit-2.0.1

- old
+ new

@@ -26,15 +26,16 @@ def record(result) @results << result end def report - doc = Ox::Document.new(:version => '1.0') + doc = Ox::Document.new(version: '1.0', encoding: 'UTF-8') instruct = Ox::Instruct.new(:xml) instruct[:version] = '1.0' instruct[:encoding] = 'UTF-8' doc << instruct + testsuite = Ox::Element.new('testsuite') testsuite['name'] = @options[:name] || 'minitest' testsuite['timestamp'] = @options[:timestamp] testsuite['hostname'] = @options[:hostname] testsuite['tests'] = @results.size @@ -44,11 +45,14 @@ testsuite['time'] = format_time(@results.map(&:time).inject(0, :+)) @results.each do |result| testsuite << format(result) end - doc << testsuite + testsuites = Ox::Element.new('testsuites') + testsuites << testsuite + + doc << testsuites @io << Ox.dump(doc) end def format(result, parent = nil) testcase = Ox::Element.new('testcase') @@ -85,13 +89,9 @@ end end def working_directory @working_directory ||= Dir.getwd - end - - def failure_message(result) - "#{result.klass}##{result.name}: #{result.failure}" end def relative_to_cwd(path) path.sub(working_directory, '.') end