Class: RSpec::Core::Configuration::DeprecationReporterBuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/configuration.rb

Overview

This buffer is used to capture all messages sent to the reporter during reporter initialization. It can then replay those messages after the formatter is correctly initialized. Otherwise, deprecation warnings during formatter initialization can cause an infinite loop.

Instance Method Summary collapse

Constructor Details

#initializeDeprecationReporterBuffer

Returns a new instance of DeprecationReporterBuffer



936
937
938
# File 'lib/rspec/core/configuration.rb', line 936

def initialize
  @calls = []
end

Instance Method Details

#deprecation(*args) ⇒ Object



940
941
942
# File 'lib/rspec/core/configuration.rb', line 940

def deprecation(*args)
  @calls << args
end

#play_onto(reporter) ⇒ Object



944
945
946
947
948
# File 'lib/rspec/core/configuration.rb', line 944

def play_onto(reporter)
  @calls.each do |args|
    reporter.deprecation(*args)
  end
end