Class: Minitest::Reporters::DelegateReporter

Inherits:
AbstractReporter
  • Object
show all
Defined in:
lib/minitest/minitest_reporter_plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(reporters, options = {}) ⇒ DelegateReporter

Returns a new instance of DelegateReporter.



4
5
6
7
8
# File 'lib/minitest/minitest_reporter_plugin.rb', line 4

def initialize(reporters, options = {})
  @reporters = reporters
  @options = options
  @all_reporters = nil
end

Instance Method Details

#io



10
11
12
13
# File 'lib/minitest/minitest_reporter_plugin.rb', line 10

def io
  all_reporters.first.io unless all_reporters.empty?
  @options[:io]
end

#passed?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/minitest/minitest_reporter_plugin.rb', line 29

def passed?
  all_reporters.all?(&:passed?)
end

#record(result)



19
20
21
22
23
# File 'lib/minitest/minitest_reporter_plugin.rb', line 19

def record(result)
  all_reporters.each do |reporter|
    reporter.record result
  end
end

#report



25
26
27
# File 'lib/minitest/minitest_reporter_plugin.rb', line 25

def report
  all_reporters.each(&:report)
end

#start



15
16
17
# File 'lib/minitest/minitest_reporter_plugin.rb', line 15

def start
  all_reporters.each(&:start)
end