18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/test/unit/testsuite_xml.rb', line 18
def xml_element
node = if @tests.first.is_a?(TestSuite)
REXML::Element.new("testsuites")
else
testsuite = REXML::Element.new("testsuite")
testsuite.add_attributes(
'name' => @name,
'tests' => test_count.to_s,
'failures' => failure_count.to_s,
'errors' => error_count.to_s,
'time' => @elapsed_time.to_s,
'timestamp' => @before_time.xmlschema
)
testsuite
end
@tests.each do |test|
xml_element = test.xml_element
node.elements << xml_element if xml_element
end
return nil if node.elements.empty?
node
end
|