Class: Minitest::CompositeReporter

Inherits:
AbstractReporter show all
Defined in:
lib/minitest.rb

Overview

Dispatch to multiple reporters as one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractReporter

#synchronize

Constructor Details

#initialize(*reporters) ⇒ CompositeReporter

:nodoc:



995
996
997
998
# File 'lib/minitest.rb', line 995

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



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

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



1007
1008
1009
# File 'lib/minitest.rb', line 1007

def << reporter
  self.reporters << reporter
end

#ioObject

:nodoc:



1000
1001
1002
# File 'lib/minitest.rb', line 1000

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

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


1011
1012
1013
# File 'lib/minitest.rb', line 1011

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

#prerecord(klass, name) ⇒ Object

:nodoc:



1019
1020
1021
1022
1023
# File 'lib/minitest.rb', line 1019

def prerecord klass, name # :nodoc:
  self.reporters.each do |reporter|
    reporter.prerecord klass, name
  end
end

#record(result) ⇒ Object

:nodoc:



1025
1026
1027
1028
1029
# File 'lib/minitest.rb', line 1025

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

#reportObject

:nodoc:



1031
1032
1033
# File 'lib/minitest.rb', line 1031

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

#startObject

:nodoc:



1015
1016
1017
# File 'lib/minitest.rb', line 1015

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