Skip to content

Commit 97ae5f3

Browse files
committed
Fix offenses for InternalAffairs/NodePatternGroups cop
This cop added following PR: - rubocop/rubocop#13762
1 parent 812bdfe commit 97ae5f3

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

lib/rubocop/cop/rspec/context_wording.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ContextWording < Base
6767

6868
# @!method context_wording(node)
6969
def_node_matcher :context_wording, <<~PATTERN
70-
(block (send #rspec? { :context :shared_context } $({str dstr xstr} ...) ...) ...)
70+
(block (send #rspec? { :context :shared_context } $(any_str ...) ...) ...)
7171
PATTERN
7272

7373
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler

lib/rubocop/cop/rspec/mixin/final_end_location.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module RSpec
77
module FinalEndLocation
88
def final_end_location(start_node)
99
heredoc_endings =
10-
start_node.each_node(:str, :dstr, :xstr)
10+
start_node.each_node(:any_str)
1111
.select(&:heredoc?)
1212
.map { |node| node.loc.heredoc_end }
1313

lib/rubocop/cop/rspec/mixin/variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Variable
1313
# @!method variable_definition?(node)
1414
def_node_matcher :variable_definition?, <<~PATTERN
1515
(send nil? {#Subjects.all #Helpers.all}
16-
$({sym str dsym dstr} ...) ...)
16+
$({any_sym str dstr} ...) ...)
1717
PATTERN
1818
end
1919
end

lib/rubocop/cop/rspec/predicate_matcher.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,7 @@ def uncorrectable_matcher?(node, matcher)
181181
end
182182

183183
def heredoc_argument?(matcher)
184-
matcher.arguments.select do |arg|
185-
arg.type?(:str, :dstr, :xstr)
186-
end.any?(&:heredoc?)
184+
matcher.arguments.select(&:any_str_type?).any?(&:heredoc?)
187185
end
188186

189187
# @!method predicate_matcher?(node)

lib/rubocop/cop/rspec/sort_metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SortMetadata < Base
3030

3131
# @!method match_ambiguous_trailing_metadata?(node)
3232
def_node_matcher :match_ambiguous_trailing_metadata?, <<~PATTERN
33-
(send _ _ _ ... !{hash sym str dstr xstr})
33+
(send _ _ _ ... !{hash sym any_str})
3434
PATTERN
3535

3636
def on_metadata(args, hash)

lib/rubocop/cop/rspec/variable_definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def string?(node)
6969
end
7070

7171
def symbol?(node)
72-
node.type?(:sym, :dsym)
72+
node.any_sym_type?
7373
end
7474
end
7575
end

0 commit comments

Comments
 (0)