Class: RuboCop::Cop::RSpec::VariableDefinition
- Includes:
- ConfigurableEnforcedStyle, Variable
- Defined in:
- lib/rubocop/cop/rspec/variable_definition.rb
Overview
Checks that memoized helpers names are symbols or strings.
Constant Summary collapse
- MSG =
'Use %<style>s for variable names.'
Constants included from Variable
RuboCop::Cop::RSpec::Variable::Helpers, RuboCop::Cop::RSpec::Variable::Subjects
Instance Method Summary collapse
Methods inherited from Base
inherited, #on_new_investigation
Methods included from RSpec::Language::NodePattern
Instance Method Details
#on_send(node) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/rubocop/cop/rspec/variable_definition.rb', line 31 def on_send(node) variable_definition?(node) do |variable| if style_violation?(variable) add_offense(variable, message: format(MSG, style: style)) end end end |