Class: Tunit::CompoundReporter

Inherits:
Reporter
  • Object
show all
Defined in:
lib/tunit/compound_reporter.rb

Instance Attribute Summary collapse

Attributes inherited from Reporter

#assertions, #count, #errors, #failures, #io, #options, #results, #skips, #start_time, #total_time

Instance Method Summary collapse

Constructor Details

#initialize(*reporters) ⇒ CompoundReporter

Returns a new instance of CompoundReporter.



5
6
7
8
# File 'lib/tunit/compound_reporter.rb', line 5

def initialize *reporters
  super()
  self.reporters = reporters
end

Instance Attribute Details

#reportersObject

Returns the value of attribute reporters.



9
10
11
# File 'lib/tunit/compound_reporter.rb', line 9

def reporters
  @reporters
end

Instance Method Details

#<<(reporter) ⇒ Object



11
12
13
# File 'lib/tunit/compound_reporter.rb', line 11

def << reporter
  self.reporters << reporter
end

#passed?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/tunit/compound_reporter.rb', line 15

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

#record(result) ⇒ Object



23
24
25
26
27
# File 'lib/tunit/compound_reporter.rb', line 23

def record result
  self.reporters.each do |reporter|
    reporter.record result
  end
end

#reportObject



29
30
31
# File 'lib/tunit/compound_reporter.rb', line 29

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

#startObject



19
20
21
# File 'lib/tunit/compound_reporter.rb', line 19

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