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:



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

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



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

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



621
622
623
# File 'lib/minitest.rb', line 621

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


625
626
627
# File 'lib/minitest.rb', line 625

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

#record(result) ⇒ Object

:nodoc:



633
634
635
636
637
# File 'lib/minitest.rb', line 633

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

#reportObject

:nodoc:



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

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

#startObject

:nodoc:



629
630
631
# File 'lib/minitest.rb', line 629

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