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
- .new(style = :regexp) ⇒ SprintReporter constructor Internal use only
::Minitest::AbstractReporter - Inherited
Instance Attribute Summary
::Minitest::AbstractReporter - Inherited
| #passed? | Did this run pass? |
Instance Method Summary
- #print_list Internal use only
- #record(result) Internal use only
- #report Internal use only
::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.
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.
# File 'lib/minitest/sprint.rb', line 37
attr_accessor :style
Instance Method Details
#print_list
This method is for internal use only.
[ GitHub ]
# File 'lib/minitest/sprint.rb', line 59
def print_list # :nodoc: case style when :regexp results.each do |result| puts " minitest -n #{result.class_name}##{result.name}" end when :lines files = Hash.new { |h,k| h[k] = [] } results.each do |result| path, line = result.source_location path = path.delete_prefix "#{Dir.pwd}/" files[path] << line end files.sort.each do |path, lines| puts " minitest %s:%s" % [path, lines.sort.join(",")] end else raise "unsupported style: %p" % [style] end end
#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