Class: Minitest::CompositeReporter

Inherits:
AbstractReporter show all
Defined in:
opal/stdlib/minitest.rb

Overview

Dispatch to multiple reporters as one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*reporters) ⇒ CompositeReporter

:nodoc:



606
607
608
609
# File 'opal/stdlib/minitest.rb', line 606

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



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

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



614
615
616
# File 'opal/stdlib/minitest.rb', line 614

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:



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

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

#record(result) ⇒ Object

:nodoc:



626
627
628
629
630
# File 'opal/stdlib/minitest.rb', line 626

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

#reportObject

:nodoc:



632
633
634
# File 'opal/stdlib/minitest.rb', line 632

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

#startObject

:nodoc:



622
623
624
# File 'opal/stdlib/minitest.rb', line 622

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