Struct.new(:name, :time, :assertions)
Structure used to represent an individual test case. Used to time the test and store the result.
Returns non-nil if the test had an error.
# File lib/ci/reporter/test_suite.rb, line 124 def error? !failures.empty? && failures.detect {|f| f.error? } end
Returns non-nil if the test failed.
# File lib/ci/reporter/test_suite.rb, line 119 def failure? !failures.empty? && failures.detect {|f| f.failure? } end
Finishes timing the test.
# File lib/ci/reporter/test_suite.rb, line 114 def finish self.time = Time.now - @start end
# File lib/ci/reporter/test_suite.rb, line 128 def skipped? return skipped end
Starts timing the test.
# File lib/ci/reporter/test_suite.rb, line 109 def start @start = Time.now end
Writes xml representing the test result to the provided builder.
# File lib/ci/reporter/test_suite.rb, line 133 def to_xml(builder) attrs = {} each_pair {|k,v| attrs[k] = builder.trunc!(v.to_s) unless v.nil? || v.to_s.empty?} builder.testcase(attrs) do if skipped builder.skipped else failures.each do |failure| builder.failure(:type => builder.trunc!(failure.name), :message => builder.trunc!(failure.message)) do builder.text!(failure.message + " (#{failure.name})\n") builder.text!(failure.location) end end end end end
Generated with the Darkfish Rdoc Generator 2.