class RSpec::Core::Formatters::DeprecationFormatter

@private

Constants

DEPRECATION_STREAM_NOTICE
GeneratedDeprecationMessage

@private

RAISE_ERROR_CONFIG_NOTICE
SpecifiedDeprecationMessage

@private

TOO_MANY_WARNINGS_NOTICE

Attributes

count[R]
deprecation_stream[R]
output[R]
summary_stream[R]

Public Class Methods

new(deprecation_stream, summary_stream) click to toggle source
# File lib/rspec/core/formatters/deprecation_formatter.rb, line 12
def initialize(deprecation_stream, summary_stream)
  @deprecation_stream = deprecation_stream
  @summary_stream = summary_stream
  @seen_deprecations = Set.new
  @count = 0
end

Public Instance Methods

deprecation(notification) click to toggle source
# File lib/rspec/core/formatters/deprecation_formatter.rb, line 32
def deprecation(notification)
  return if @seen_deprecations.include? notification

  @count += 1
  printer.print_deprecation_message notification
  @seen_deprecations << notification
end
deprecation_message_for(data) click to toggle source
# File lib/rspec/core/formatters/deprecation_formatter.rb, line 44
def deprecation_message_for(data)
  if data.message
    SpecifiedDeprecationMessage.new(data)
  else
    GeneratedDeprecationMessage.new(data)
  end
end
deprecation_summary(_notification) click to toggle source
# File lib/rspec/core/formatters/deprecation_formatter.rb, line 40
def deprecation_summary(_notification)
  printer.deprecation_summary
end
printer() click to toggle source
# File lib/rspec/core/formatters/deprecation_formatter.rb, line 20
def printer
  @printer ||= case deprecation_stream
               when File
                 ImmediatePrinter.new(FileStream.new(deprecation_stream),
                                      summary_stream, self)
               when RaiseErrorStream
                 ImmediatePrinter.new(deprecation_stream, summary_stream, self)
               else
                 DelayedPrinter.new(deprecation_stream, summary_stream, self)
               end
end