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

Constructor Details

#initialize(*reporters) ⇒ CompositeReporter

:nodoc:



641
642
643
644
# File 'lib/minitest.rb', line 641

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



639
640
641
# File 'lib/minitest.rb', line 639

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



653
654
655
# File 'lib/minitest.rb', line 653

def << reporter
  self.reporters << reporter
end

#ioObject

:nodoc:



646
647
648
# File 'lib/minitest.rb', line 646

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

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


657
658
659
# File 'lib/minitest.rb', line 657

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

#prerecord(klass, name) ⇒ Object

:nodoc:



665
666
667
668
669
# File 'lib/minitest.rb', line 665

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

#record(result) ⇒ Object

:nodoc:



671
672
673
674
675
# File 'lib/minitest.rb', line 671

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

#reportObject

:nodoc:



677
678
679
# File 'lib/minitest.rb', line 677

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

#startObject

:nodoc:



661
662
663
# File 'lib/minitest.rb', line 661

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