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:



558
559
560
# File 'lib/minitest.rb', line 558

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



556
557
558
# File 'lib/minitest.rb', line 556

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



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

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


569
570
571
# File 'lib/minitest.rb', line 569

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

#record(result) ⇒ Object

:nodoc:



577
578
579
580
581
# File 'lib/minitest.rb', line 577

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

#reportObject

:nodoc:



583
584
585
# File 'lib/minitest.rb', line 583

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

#startObject

:nodoc:



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

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