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)

35
36
37
# File 'lib/minitest/minitest_reporter_plugin.rb', line 35

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

#prerecord(klass, name)


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

def prerecord(klass, name)
  all_reporters.each do |reporter|
    reporter.prerecord klass, name
  end
end

#record(result)


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

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

#report


31
32
33
# File 'lib/minitest/minitest_reporter_plugin.rb', line 31

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