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:



592
593
594
595
# File 'lib/minitest.rb', line 592

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



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

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



600
601
602
# File 'lib/minitest.rb', line 600

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


604
605
606
# File 'lib/minitest.rb', line 604

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

#record(result) ⇒ Object

:nodoc:



612
613
614
615
616
# File 'lib/minitest.rb', line 612

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

#reportObject

:nodoc:



618
619
620
# File 'lib/minitest.rb', line 618

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

#startObject

:nodoc:



608
609
610
# File 'lib/minitest.rb', line 608

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