Module: Test::Unit::XMLReportable

Includes:
ERB::Util
Included in:
Error, Failure, Success
Defined in:
lib/test-unit-ext/xml-report.rb

Instance Method Summary collapse

Instance Method Details

#to_xmlObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/test-unit-ext/xml-report.rb', line 13

def to_xml
  <<-XML.gsub(/\s*(\n  <\/test>|\n<\/result>)/m, "\\1")
<result>
  <test_case>
    <name>#{h(@test.class.name)}</name>
    <description/>
  </test_case>
  <test>
    <name>#{h(@test.method_name)}</name>
    <description/>
#{options_xml}
  </test>
  <status>#{h(status_name)}</status>
  <detail>#{h(message)}</detail>
  <elapsed>#{h(elapsed_time)}</elapsed>
#{backtrace_xml}
</result>
XML
end