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:



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

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



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

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



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

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


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

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

#record(result) ⇒ Object

:nodoc:



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

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

#reportObject

:nodoc:



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

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

#startObject

:nodoc:



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

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