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:



565
566
567
# File 'lib/minitest.rb', line 565

def initialize *reporters # :nodoc:
  self.reporters = reporters
end

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



563
564
565
# File 'lib/minitest.rb', line 563

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



572
573
574
# File 'lib/minitest.rb', line 572

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


576
577
578
# File 'lib/minitest.rb', line 576

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

#record(result) ⇒ Object

:nodoc:



584
585
586
587
588
# File 'lib/minitest.rb', line 584

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

#reportObject

:nodoc:



590
591
592
# File 'lib/minitest.rb', line 590

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

#startObject

:nodoc:



580
581
582
# File 'lib/minitest.rb', line 580

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