Class: RuboCop::Cop::InSpecStyle::DeprecatedAttributes
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::InSpecStyle::DeprecatedAttributes
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/inspecstyle/deprecated_attributes.rb
Overview
Checks if deprecated method attribute is used.
Constant Summary collapse
- MSG =
'Use `#input` instead of `#attribute`. This will be removed in '\ 'InSpec 5'
Instance Method Summary collapse
Instance Method Details
#autocorrect(node) ⇒ Object
34 35 36 37 38 |
# File 'lib/rubocop/cop/inspecstyle/deprecated_attributes.rb', line 34 def autocorrect(node) lambda do |corrector| corrector.replace(offense_range(node), preferred_replacement) end end |
#on_send(node) ⇒ Object
28 29 30 31 32 |
# File 'lib/rubocop/cop/inspecstyle/deprecated_attributes.rb', line 28 def on_send(node) return unless attribute?(node) add_offense(node, location: node.loc.selector) end |