diff --git a/lib/rubocop/cop/rspec/variable_definition.rb b/lib/rubocop/cop/rspec/variable_definition.rb index 4bfe1509b..8a166bea0 100644 --- a/lib/rubocop/cop/rspec/variable_definition.rb +++ b/lib/rubocop/cop/rspec/variable_definition.rb @@ -60,16 +60,8 @@ def correct_variable(variable) end def style_offense?(variable) - (style == :symbols && string?(variable)) || - (style == :strings && symbol?(variable)) - end - - def string?(node) - node.str_type? - end - - def symbol?(node) - node.any_sym_type? + (style == :symbols && variable.str_type?) || + (style == :strings && variable.any_sym_type?) end end end