Class: Minitest::FlakeyStatisticsReporter
- Inherits:
-
StatisticsReporter
- Object
- StatisticsReporter
- Minitest::FlakeyStatisticsReporter
- Defined in:
- lib/minitest/rake_ci_plugin.rb
Overview
Intermediate Reporter than can also track flakey failures
Direct Known Subclasses
Instance Attribute Summary collapse
-
#flakey_results ⇒ Object
Returns the value of attribute flakey_results.
Instance Method Summary collapse
- #flakes ⇒ Object
-
#initialize ⇒ FlakeyStatisticsReporter
constructor
A new instance of FlakeyStatisticsReporter.
- #record(result) ⇒ Object
Constructor Details
#initialize ⇒ FlakeyStatisticsReporter
Returns a new instance of FlakeyStatisticsReporter.
16 17 18 19 20 |
# File 'lib/minitest/rake_ci_plugin.rb', line 16 def initialize(*) super self.flakey_results = [] end |
Instance Attribute Details
#flakey_results ⇒ Object
Returns the value of attribute flakey_results.
14 15 16 |
# File 'lib/minitest/rake_ci_plugin.rb', line 14 def flakey_results @flakey_results end |
Instance Method Details
#flakes ⇒ Object
30 31 32 |
# File 'lib/minitest/rake_ci_plugin.rb', line 30 def flakes flakey_results.sum { |result| result.flakes.length } end |
#record(result) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/minitest/rake_ci_plugin.rb', line 22 def record(result) super return unless result.respond_to?(:flakes) flakey_results << result if result.flakes.any? end |