123456789_123456789_123456789_123456789_123456789_

Class: Minitest::CompositeReporter

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

Overview

Dispatch to multiple reporters as one.

Class Method Summary

Instance Attribute Summary

AbstractReporter - Inherited

#passed?

Did this run pass?

Instance Method Summary

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.

Constructor Details

.new(*reporters) ⇒ CompositeReporter

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 841

def initialize *reporters # :nodoc:
  super()
  self.reporters = reporters
end

Instance Attribute Details

#passed?Boolean (readonly)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 857

def passed? # :nodoc:
  self.reporters.all?(&:passed?)
end

#reporters (rw)

The list of reporters to dispatch to.

[ GitHub ]

  
# File 'lib/minitest.rb', line 839

attr_accessor :reporters

Instance Method Details

#<<(reporter)

Add another reporter to the mix.

[ GitHub ]

  
# File 'lib/minitest.rb', line 853

def << reporter
  self.reporters << reporter
end

#io

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 846

def io # :nodoc:
  reporters.first.io
end

#prerecord(klass, name)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 865

def prerecord klass, name # :nodoc:
  self.reporters.each do |reporter|
    # TODO: remove conditional for minitest 6
    reporter.prerecord klass, name if reporter.respond_to? :prerecord
  end
end

#record(result)

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 872

def record result # :nodoc:
  self.reporters.each do |reporter|
    reporter.record result
  end
end

#report

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 878

def report # :nodoc:
  self.reporters.each(&:report)
end

#start

This method is for internal use only.
[ GitHub ]

  
# File 'lib/minitest.rb', line 861

def start # :nodoc:
  self.reporters.each(&:start)
end