123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Formatters::DeprecationFormatter::DelayedPrinter Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#deprecation_formatter (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 138

attr_reader :deprecation_stream, :summary_stream, :deprecation_formatter

#deprecation_stream (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 138

attr_reader :deprecation_stream, :summary_stream, :deprecation_formatter

#summary_stream (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 138

attr_reader :deprecation_stream, :summary_stream, :deprecation_formatter

Instance Method Details

#deprecation_summary

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 163

def deprecation_summary
  return unless @deprecation_messages.any?

  print_deferred_deprecation_warnings
  deprecation_stream.puts RAISE_ERROR_CONFIG_NOTICE

  summary_stream.puts "\n#{Helpers.pluralize(deprecation_formatter.count, 'deprecation warning')} total"
end

#stash_deprecation_message(deprecation_message)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 155

def stash_deprecation_message(deprecation_message)
  if @seen_deprecations[deprecation_message] < TOO_MANY_USES_LIMIT
    @deprecation_messages[deprecation_message] << deprecation_message.to_s
  elsif @seen_deprecations[deprecation_message] == TOO_MANY_USES_LIMIT
    @deprecation_messages[deprecation_message] << deprecation_message.too_many_warnings_message
  end
end