Class: Minitest::Reporters::BaseReporter
- Inherits:
-
StatisticsReporter
- Object
- StatisticsReporter
- Minitest::Reporters::BaseReporter
- Defined in:
- lib/minitest/reporters/base_reporter.rb
Direct Known Subclasses
DefaultReporter, HtmlReporter, JUnitReporter, ProgressReporter, RubyMateReporter, SpecReporter
Instance Attribute Summary collapse
-
#tests
Returns the value of attribute tests.
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.
6 7 8 9 |
# File 'lib/minitest/reporters/base_reporter.rb', line 6 def initialize(={}) super($stdout, ) self.tests = [] end |
Instance Attribute Details
#tests
Returns the value of attribute tests.
4 5 6 |
# File 'lib/minitest/reporters/base_reporter.rb', line 4 def tests @tests end |
Instance Method Details
#add_defaults(defaults)
11 12 13 |
# File 'lib/minitest/reporters/base_reporter.rb', line 11 def add_defaults(defaults) self. = defaults.merge() end |
#after_test(test)
called by our own after hooks
30 31 |
# File 'lib/minitest/reporters/base_reporter.rb', line 30 def after_test(test) end |
#before_test(test)
called by our own before hooks
16 17 18 19 20 21 22 |
# File 'lib/minitest/reporters/base_reporter.rb', line 16 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)
24 25 26 27 |
# File 'lib/minitest/reporters/base_reporter.rb', line 24 def record(test) super tests << test end |
#report
33 34 35 36 |
# File 'lib/minitest/reporters/base_reporter.rb', line 33 def report super after_suite(tests.last.class) end |