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
-
TOO_MANY_USES_LIMIT =
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 1364
Class Method Summary
- .new(deprecation_stream, summary_stream, deprecation_formatter) ⇒ DelayedPrinter constructor Internal use only
Instance Attribute Summary
- #deprecation_formatter readonly Internal use only
- #deprecation_stream readonly Internal use only
- #summary_stream readonly Internal use only
Instance Method Summary
- #deprecation_summary Internal use only
- #print_deferred_deprecation_warnings Internal use only
- #print_deprecation_message(data) Internal use only
- #stash_deprecation_message(deprecation_message) Internal use only
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
#print_deferred_deprecation_warnings
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 172
def print_deferred_deprecation_warnings deprecation_stream.puts "\nDeprecation Warnings:\n\n" @deprecation_messages.keys.sort_by(&:type).each do |deprecation| = @deprecation_messages[deprecation] .each { |msg| deprecation_stream.puts msg } deprecation_stream.puts end end
#print_deprecation_message(data)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 148
def (data) = deprecation_formatter. (data) @seen_deprecations[ ] += 1 ( ) end
#stash_deprecation_message(deprecation_message)
[ GitHub ]# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 155
def ( ) if @seen_deprecations[ ] < TOO_MANY_USES_LIMIT @deprecation_messages[ ] << .to_s elsif @seen_deprecations[ ] == TOO_MANY_USES_LIMIT @deprecation_messages[ ] << . end end