class Minitest::Reporters::JUnitReporter

def parse_xml_for(xml, suite, tests)

def parse_xml_for(xml, suite, tests)
  suite_result = analyze_suite(tests)
  file_path = get_relative_path(tests.first)
  xml.testsuite(:name => suite, :filepath => file_path,
                :skipped => suite_result[:skip_count], :failures => suite_result[:fail_count],
                :errors => suite_result[:error_count], :tests => suite_result[:test_count],
                :assertions => suite_result[:assertion_count], :time => suite_result[:time]) do
    tests.each do |test|
      lineno = get_source_location(test).last
      xml.testcase(:name => test.name, :lineno => lineno, :classname => suite, :assertions => test.assertions,
                   :time => test.time) do
        xml << xml_message_for(test) unless test.passed?
      end
    end
  end
end