lib/rubocop/cop/rspec/subject_stub.rb in rubocop-rspec-1.43.2 vs lib/rubocop/cop/rspec/subject_stub.rb in rubocop-rspec-1.44.0

- old
+ new

@@ -41,13 +41,13 @@ # # @param node [RuboCop::AST::Node] # # @yield [Symbol] subject name def_node_matcher :subject, <<-PATTERN - { - (block (send nil? :subject (sym $_)) args ...) - (block (send nil? $:subject) args ...) - } + (block + (send nil? + {:subject (sym $_) | $:subject} + ) args ...) PATTERN # @!method message_expectation?(node, method_name) # Match `allow` and `expect(...).to receive` #