Class: Minitest::Reporters::BaseReporter
- Inherits:
-
StatisticsReporter
- Object
- StatisticsReporter
- Minitest::Reporters::BaseReporter
- Defined in:
- lib/minitest/reporters/base_reporter.rb
Direct Known Subclasses
DefaultReporter, JUnitReporter, ProgressReporter, RubyMateReporter, SpecReporter
Instance Attribute Summary collapse
-
#tests
Returns the value of attribute tests.
-
#total_count
writeonly
Sets the attribute total_count.
Instance Method Summary collapse
- #add_defaults(defaults)
-
#after_test(test)
called by our own after hooks.
-
#before_test(test)
called by our own before hooks.
-
#initialize(options = {}) ⇒ BaseReporter
constructor
A new instance of BaseReporter.
- #record(test)
- #report
Constructor Details
#initialize(options = {}) ⇒ BaseReporter
Returns a new instance of BaseReporter.
7 8 9 10 |
# File 'lib/minitest/reporters/base_reporter.rb', line 7 def initialize(={}) super($stdout, ) self.tests = [] end |
Instance Attribute Details
#tests
Returns the value of attribute tests.
5 6 7 |
# File 'lib/minitest/reporters/base_reporter.rb', line 5 def tests @tests end |
#total_count=(value)
Sets the attribute total_count
4 5 6 |
# File 'lib/minitest/reporters/base_reporter.rb', line 4 def total_count=(value) @total_count = value end |
Instance Method Details
#add_defaults(defaults)
12 13 14 |
# File 'lib/minitest/reporters/base_reporter.rb', line 12 def add_defaults(defaults) self. = defaults.merge() end |
#after_test(test)
called by our own after hooks
31 32 |
# File 'lib/minitest/reporters/base_reporter.rb', line 31 def after_test(test) end |
#before_test(test)
called by our own before hooks
17 18 19 20 21 22 23 |
# File 'lib/minitest/reporters/base_reporter.rb', line 17 def before_test(test) last_test = tests.last if last_test.class != test.class after_suite(last_test.class) if last_test before_suite(test.class) end end |
#record(test)
25 26 27 28 |
# File 'lib/minitest/reporters/base_reporter.rb', line 25 def record(test) super tests << test end |
#report
34 35 36 37 |
# File 'lib/minitest/reporters/base_reporter.rb', line 34 def report super after_suite(tests.last.class) end |