lib/rubocop/cop/rspec/unspecified_exception.rb in rubocop-rspec-3.0.5 vs lib/rubocop/cop/rspec/unspecified_exception.rb in rubocop-rspec-3.1.0
- old
+ new
@@ -60,10 +60,13 @@
true
end
def find_expect_to(node)
- node.each_ancestor(:send).find do |ancestor|
+ node.each_ancestor.find do |ancestor|
+ break if ancestor.block_type?
+ next unless ancestor.send_type?
+
expect_to?(ancestor)
end
end
end
end