123456789_123456789_123456789_123456789_123456789_

Class: Minitest::CompositeReporter

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

Overview

Dispatch to multiple reporters as one.

Class Method Summary

AbstractReporter - Inherited

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.

#synchronize

Constructor Details

.new(*reporters) ⇒ CompositeReporter

This method is for internal use only.
[ GitHub ]

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

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 991

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

#reporters (rw)

The list of reporters to dispatch to.

[ GitHub ]

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

attr_accessor :reporters

Instance Method Details

#<<(reporter)

Add another reporter to the mix.

[ GitHub ]

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

def << reporter
  self.reporters << reporter
end

#io

This method is for internal use only.
[ GitHub ]

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

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

#prerecord(klass, name)

This method is for internal use only.
[ GitHub ]

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

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 1006

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 1012

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

#start

This method is for internal use only.
[ GitHub ]

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

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