Class: RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage
- Inherits:
-
Struct
- Object
- Struct
- RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage
- Defined in:
- lib/rspec/core/formatters/deprecation_formatter.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ GeneratedDeprecationMessage
constructor
A new instance of GeneratedDeprecationMessage.
- #to_s ⇒ Object
- #too_many_warnings_message ⇒ Object
Constructor Details
#initialize(data) ⇒ GeneratedDeprecationMessage
Returns a new instance of GeneratedDeprecationMessage.
93 94 95 96 |
# File 'lib/rspec/core/formatters/deprecation_formatter.rb', line 93 def initialize(data) @data = data super data.fetch(:type, data[:deprecated]) end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type
92 93 94 |
# File 'lib/rspec/core/formatters/deprecation_formatter.rb', line 92 def type @type end |
Instance Method Details
#to_s ⇒ Object
98 99 100 101 102 103 |
# File 'lib/rspec/core/formatters/deprecation_formatter.rb', line 98 def to_s msg = "#{@data[:deprecated]} is deprecated." msg << " Use #{@data[:replacement]} instead." if @data[:replacement] msg << " Called from #{@data[:call_site]}." if @data[:call_site] msg end |
#too_many_warnings_message ⇒ Object
105 106 107 108 109 |
# File 'lib/rspec/core/formatters/deprecation_formatter.rb', line 105 def msg = "Too many uses of deprecated '#{type}'. " msg << DEPRECATION_STREAM_NOTICE msg end |