Class: Minitest::CompositeReporter

Inherits:
Reporter show all
Defined in:
lib/minitest.rb

Overview

Dispatch to multiple reporters as one.

Instance Attribute Summary collapse

Attributes inherited from Reporter

#assertions, #count, #io, #old_sync, #options, #results, #start_time, #sync

Instance Method Summary collapse

Methods inherited from Reporter

#run_and_report, #simple_record, synchronize

Constructor Details

#initialize(*reporters) ⇒ CompositeReporter

:nodoc:



475
476
477
# File 'lib/minitest.rb', line 475

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

Instance Attribute Details

#reportersObject

The list of reporters to dispatch to.



473
474
475
# File 'lib/minitest.rb', line 473

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object

Add another reporter to the mix.



482
483
484
# File 'lib/minitest.rb', line 482

def << reporter
  self.reporters << reporter
end

#passed?Boolean

:nodoc:

Returns:

  • (Boolean)


486
487
488
# File 'lib/minitest.rb', line 486

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

#record(result) ⇒ Object

:nodoc:



494
495
496
497
498
# File 'lib/minitest.rb', line 494

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

#reportObject

:nodoc:



500
501
502
# File 'lib/minitest.rb', line 500

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

#startObject

:nodoc:



490
491
492
# File 'lib/minitest.rb', line 490

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