Module: Spectre::Reporter

Defined in:
lib/spectre/reporter.rb,
lib/spectre/reporter/console.rb

Defined Under Namespace

Classes: Console

Constant Summary collapse

@@reporters =
[]

Class Method Summary collapse

Class Method Details

.add(reporter) ⇒ Object

Raises:

  • (NotImplementedError)


5
6
7
8
9
# File 'lib/spectre/reporter.rb', line 5

def self.add reporter
  raise NotImplementedError.new("#{reporter} does not implement `report' method") unless reporter.respond_to? :report

  @@reporters.append(reporter)
end

.report(run_infos) ⇒ Object



11
12
13
14
15
# File 'lib/spectre/reporter.rb', line 11

def self.report run_infos
  @@reporters.each do |reporter|
    reporter.report(run_infos)
  end
end