Skip to content

Commit 75ba9c2

Browse files
authored
Merge pull request #2115 from rubocop/inlined
Refactor style_offense? method to simplify offense checks for variable types
2 parents 4cfb3fd + 7cd8e41 commit 75ba9c2

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/rubocop/cop/rspec/variable_definition.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,8 @@ def correct_variable(variable)
6060
end
6161

6262
def style_offense?(variable)
63-
(style == :symbols && string?(variable)) ||
64-
(style == :strings && symbol?(variable))
65-
end
66-
67-
def string?(node)
68-
node.str_type?
69-
end
70-
71-
def symbol?(node)
72-
node.any_sym_type?
63+
(style == :symbols && variable.str_type?) ||
64+
(style == :strings && variable.any_sym_type?)
7365
end
7466
end
7567
end

0 commit comments

Comments
 (0)