@@ -110,10 +110,9 @@ class EmptyExampleGroup < Base
110110 # end
111111 #
112112 # @param node [RuboCop::AST::Node]
113- # @param %1 [Proc] Function to match hooks
114113 # @return [Array<RuboCop::AST::Node>] matching nodes
115114 def_node_matcher :examples_inside_block? , <<~PATTERN
116- (block !#{ SEND_PATTERN } _ #examples?(%1) )
115+ (block !#{ RuboCop :: RSpec :: Language . send_pattern ( '#rspec_hooks' ) } _ #examples?)
117116 PATTERN
118117
119118 # @!method examples_directly_or_in_block?(node)
@@ -125,12 +124,11 @@ class EmptyExampleGroup < Base
125124 # (1..5).each { |divisor| it { is_expected.to divide_by(divisor) } }
126125 #
127126 # @param node [RuboCop::AST::Node]
128- # @param %1 [Proc] Function to match hooks
129127 # @return [Array<RuboCop::AST::Node>] matching nodes
130128 def_node_matcher :examples_directly_or_in_block? , <<~PATTERN
131129 {
132130 #example_or_group_or_include?
133- #examples_inside_block?(%1)
131+ #examples_inside_block?
134132 }
135133 PATTERN
136134
@@ -145,18 +143,17 @@ class EmptyExampleGroup < Base
145143 # before { it { whatever here wont run anyway } }
146144 #
147145 # @param node [RuboCop::AST::Node]
148- # @param %1 [Proc] Function to match hooks
149146 # @return [Array<RuboCop::AST::Node>] matching nodes
150147 def_node_matcher :examples? , <<~PATTERN
151148 {
152- #examples_directly_or_in_block?(%1)
153- (begin <#examples_directly_or_in_block?(%1) ...>)
149+ #examples_directly_or_in_block?
150+ (begin <#examples_directly_or_in_block? ...>)
154151 }
155152 PATTERN
156153
157154 def on_block ( node )
158155 example_group_body ( node ) do |body |
159- add_offense ( node . send_node ) unless examples? ( body , rspec_hooks )
156+ add_offense ( node . send_node ) unless examples? ( body )
160157 end
161158 end
162159
0 commit comments