123456789_123456789_123456789_123456789_123456789_

Class: Minitest::Sprint::SprintReporter

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Minitest::AbstractReporter
Defined in: lib/minitest/sprint.rb

Overview

An extra minitest reporter to output how to rerun failures in various styles.

Class Method Summary

Instance Attribute Summary

  • #style rw

    The style to report, either lines or regexp.

  • #results rw Internal use only

::Minitest::AbstractReporter - Inherited

#passed?

Did this run pass?

Instance Method Summary

::Minitest::AbstractReporter - Inherited

#prerecord

About to start running a test.

#record

Output and record the result of the test.

#report

Outputs the summary of the run.

#start

Starts reporting on the run.

#synchronize

Constructor Details

.new(style = :regexp) ⇒ SprintReporter

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest/sprint.rb', line 40

def initialize style = :regexp # :nodoc:
  self.results = []
  self.style = style
end

Instance Attribute Details

#results (rw)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest/sprint.rb', line 38

attr_accessor :results # :nodoc:

#style (rw)

The style to report, either lines or regexp. Defaults to lines.

[ GitHub ]

  
# File 'lib/minitest/sprint.rb', line 37

attr_accessor :style

Instance Method Details

#record(result)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest/sprint.rb', line 45

def record result # :nodoc:
  results << result unless result.passed? or result.skipped?
end

#report

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest/sprint.rb', line 49

def report # :nodoc:
  return if results.empty?

  puts
  puts "Happy Happy Sprint List:"
  puts
  print_list
  puts
end