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) ⇒ Reporter
constructor
A new instance of Reporter.
- #passed? ⇒ Boolean
- #record(result) ⇒ Object
- #report ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(io) ⇒ Reporter
Returns a new instance of Reporter.
10 11 12 13 |
# File 'lib/minitest/junit.rb', line 10 def initialize(io) @io = io @results = [] end |
Instance Method Details
#format(result) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/minitest/junit.rb', line 31 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
15 16 17 |
# File 'lib/minitest/junit.rb', line 15 def passed? true end |
#record(result) ⇒ Object
21 22 23 |
# File 'lib/minitest/junit.rb', line 21 def record(result) @results << result end |
#report ⇒ Object
25 26 27 28 29 |
# File 'lib/minitest/junit.rb', line 25 def report @io.puts '<testsuite>' @results.each { |result| @io.puts format(result) } @io.puts '</testsuite>' end |
#start ⇒ Object
19 |
# File 'lib/minitest/junit.rb', line 19 def start; end |