Class: FlakyTestTracker::Reporter::CollectionReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/flaky_test_tracker/reporter/collection_reporter.rb

Overview

Reporter for a collection of reporter.

See Also:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reporters: []) ⇒ CollectionReporter

Returns a new instance of CollectionReporter.



16
17
18
# File 'lib/flaky_test_tracker/reporter/collection_reporter.rb', line 16

def initialize(reporters: [])
  @reporters = reporters
end

Instance Attribute Details

#reporters#tracked_test #tracked_tests #resolved_test #resolved_tests

Returns the current value of reporters.

Returns:



8
9
10
# File 'lib/flaky_test_tracker/reporter/collection_reporter.rb', line 8

def reporters
  @reporters
end

Class Method Details

.build(reporters:) ⇒ Object



12
13
14
# File 'lib/flaky_test_tracker/reporter/collection_reporter.rb', line 12

def self.build(reporters:)
  new(reporters: reporters)
end

Instance Method Details

#resolved_tests(tests:) ⇒ Object



28
29
30
31
32
# File 'lib/flaky_test_tracker/reporter/collection_reporter.rb', line 28

def resolved_tests(tests:)
  reporters.each do |reporter|
    reporter.resolved_tests(tests: tests)
  end
end

#tracked_tests(tests:, source:, context:) ⇒ Object



21
22
23
24
25
# File 'lib/flaky_test_tracker/reporter/collection_reporter.rb', line 21

def tracked_tests(tests:, source:, context:)
  reporters.each do |reporter|
    reporter.tracked_tests(tests: tests, source: source, context: context)
  end
end