Class: RSpec::Core::Formatters::DeprecationFormatter Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: | Object |
Defined in: | rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb |
Constant Summary
-
DEPRECATION_STREAM_NOTICE =
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 60"Pass `--deprecation-out` or set " \ "`config.deprecation_stream` to a file for full output."
-
RAISE_ERROR_CONFIG_NOTICE =
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 52<<-EOS.gsub(/^\s+\|/, '') | |If you need more of the backtrace for any of these deprecations to |identify where to make the necessary changes, you can configure |`config.raise_errors_for_deprecations!`, and it will turn the |deprecation warnings into errors, giving you the full backtrace. EOS
-
TOO_MANY_WARNINGS_NOTICE =
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 62"Too many similar deprecation messages " \ "reported, disregarding further reports. #{DEPRECATION_STREAM_NOTICE}"
Class Method Summary
- .new(deprecation_stream, summary_stream) ⇒ DeprecationFormatter constructor Internal use only
Instance Attribute Summary
- #count readonly Internal use only
- #deprecation_stream (also: #output) readonly Internal use only
-
#output
readonly
Alias for #deprecation_stream.
- #summary_stream readonly Internal use only
Instance Method Summary
- #deprecation(notification) Internal use only
- #deprecation_message_for(data) Internal use only
- #deprecation_summary(_notification) Internal use only
- #printer Internal use only
Instance Attribute Details
#count (readonly)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 10
attr_reader :count, :deprecation_stream, :summary_stream
#deprecation_stream (readonly) Also known as: #output
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 10
attr_reader :count, :deprecation_stream, :summary_stream
#output (readonly)
Alias for #deprecation_stream.
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 18
alias :output :deprecation_stream
#summary_stream (readonly)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 10
attr_reader :count, :deprecation_stream, :summary_stream
Instance Method Details
#deprecation(notification)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 32
def deprecation(notification) return if @seen_deprecations.include? notification @count += 1 printer. notification @seen_deprecations << notification end
#deprecation_message_for(data)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 44
def (data) if data. SpecifiedDeprecationMessage.new(data) else GeneratedDeprecationMessage.new(data) end end
#deprecation_summary(_notification)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 40
def deprecation_summary(_notification) printer.deprecation_summary end
#printer
[ GitHub ]# File 'rspec-core/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