lib/rubocop/cop/rspec/unspecified_exception.rb in rubocop-rspec-2.25.0 vs lib/rubocop/cop/rspec/unspecified_exception.rb in rubocop-rspec-2.26.0
- old
+ new
@@ -33,11 +33,11 @@
class UnspecifiedException < Base
MSG = 'Specify the exception being captured'
RESTRICT_ON_SEND = %i[to].freeze
# @!method empty_raise_error_or_exception(node)
- def_node_matcher :empty_raise_error_or_exception, <<-PATTERN
+ def_node_matcher :empty_raise_error_or_exception, <<~PATTERN
(send
(block
(send nil? :expect) ...)
:to
(send nil? {:raise_error :raise_exception})
@@ -55,10 +55,10 @@
def empty_exception_matcher?(node)
empty_raise_error_or_exception(node) && !block_with_args?(node.parent)
end
def block_with_args?(node)
- return unless node&.block_type?
+ return false unless node&.block_type?
node.arguments?
end
end
end