Class: Minitest::Junit::Reporter
- Inherits:
-
Object
- Object
- Minitest::Junit::Reporter
- Defined in:
- lib/minitest/junit.rb
Overview
:nodoc:
Instance Method Summary collapse
- #format(result) ⇒ Object
-
#initialize(io, options) ⇒ Reporter
constructor
A new instance of Reporter.
- #passed? ⇒ Boolean
- #record(result) ⇒ Object
- #report ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(io, options) ⇒ Reporter
Returns a new instance of Reporter.
10 11 12 13 14 |
# File 'lib/minitest/junit.rb', line 10 def initialize(io, ) @io = io @results = [] @options = end |
Instance Method Details
#format(result) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/minitest/junit.rb', line 32 def format(result) xml = Builder::XmlMarkup.new xml.testcase classname: format_class(result), name: format_name(result), time: result.time, assertions: result.assertions do |t| t.skipped if result.skipped? result.failures.each do |failure| type = classify failure xml.tag! type, format_backtrace(failure), message: result end end xml.target! end |
#passed? ⇒ Boolean
16 17 18 |
# File 'lib/minitest/junit.rb', line 16 def passed? true end |
#record(result) ⇒ Object
22 23 24 |
# File 'lib/minitest/junit.rb', line 22 def record(result) @results << result end |
#report ⇒ Object
26 27 28 29 30 |
# File 'lib/minitest/junit.rb', line 26 def report @io.puts '<testsuite>' @results.each { |result| @io.puts format(result) } @io.puts '</testsuite>' end |
#start ⇒ Object
20 |
# File 'lib/minitest/junit.rb', line 20 def start; end |