lib/rubocop/cop/rspec/iterated_expectation.rb in rubocop-rspec-2.4.0 vs lib/rubocop/cop/rspec/iterated_expectation.rb in rubocop-rspec-2.5.0
- old
+ new
@@ -46,9 +46,11 @@
def single_expectation?(body, arg)
expectation?(body, arg)
end
def only_expectations?(body, arg)
+ return false unless body.each_child_node.any?
+
body.each_child_node.all? { |child| expectation?(child, arg) }
end
end
end
end