Class: Minitest::DocReporter::DocReporter
- Inherits:
-
AbstractReporter
- Object
- AbstractReporter
- Minitest::DocReporter::DocReporter
- Includes:
- ANSI::Code
- Defined in:
- lib/minitest/doc_reporter.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#failures ⇒ Object
Returns the value of attribute failures.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#results ⇒ Object
Returns the value of attribute results.
-
#skips ⇒ Object
Returns the value of attribute skips.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#total_time ⇒ Object
writeonly
Sets the attribute total_time.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ DocReporter
constructor
A new instance of DocReporter.
- #record(result) ⇒ Object
- #report ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ DocReporter
Returns a new instance of DocReporter.
17 18 19 20 21 22 23 24 25 |
# File 'lib/minitest/doc_reporter.rb', line 17 def initialize( = {}) @io = io @options = self.results = [] self.errors = 0 self.skips = 0 self.count = 0 self.failures = 0 end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
14 15 16 |
# File 'lib/minitest/doc_reporter.rb', line 14 def count @count end |
#errors ⇒ Object
Returns the value of attribute errors.
14 15 16 |
# File 'lib/minitest/doc_reporter.rb', line 14 def errors @errors end |
#failures ⇒ Object
Returns the value of attribute failures.
14 15 16 |
# File 'lib/minitest/doc_reporter.rb', line 14 def failures @failures end |
#io ⇒ Object (readonly)
Returns the value of attribute io.
12 13 14 |
# File 'lib/minitest/doc_reporter.rb', line 12 def io @io end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/minitest/doc_reporter.rb', line 12 def @options end |
#results ⇒ Object
Returns the value of attribute results.
12 13 14 |
# File 'lib/minitest/doc_reporter.rb', line 12 def results @results end |
#skips ⇒ Object
Returns the value of attribute skips.
14 15 16 |
# File 'lib/minitest/doc_reporter.rb', line 14 def skips @skips end |
#start_time ⇒ Object
Returns the value of attribute start_time.
14 15 16 |
# File 'lib/minitest/doc_reporter.rb', line 14 def start_time @start_time end |
#total_time=(value) ⇒ Object
Sets the attribute total_time
14 15 16 |
# File 'lib/minitest/doc_reporter.rb', line 14 def total_time=(value) @total_time = value end |
Instance Method Details
#record(result) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/minitest/doc_reporter.rb', line 32 def record(result) puts format_header(result) puts format_result(result) puts puts failure_info(result) unless result.passed? update_statistics(result) end |
#report ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/minitest/doc_reporter.rb', line 43 def report super aggregate = self.results.group_by { |r| r.failure.class } aggregate.default = [] # dumb. group_by should provide this self.failures = aggregate[Assertion].size self.errors = aggregate[UnexpectedError].size self.skips = aggregate[Skip].size puts puts format_tests_run_count(count, total_time) puts statistics puts end |
#start ⇒ Object
27 28 29 30 |
# File 'lib/minitest/doc_reporter.rb', line 27 def start puts self.start_time = Time.now end |