lib/rubocop/cop/minitest/multiple_assertions.rb in rubocop-minitest-0.26.0 vs lib/rubocop/cop/minitest/multiple_assertions.rb in rubocop-minitest-0.26.1
- old
+ new
@@ -48,11 +48,12 @@
end
private
def assertions_count(node)
- base = assertion_method?(node) ? 1 : 0
- base + node.each_child_node.sum { |c| assertions_count(c) }
+ node.each_descendant(:send).count do |send_node|
+ assertion_method?(send_node)
+ end
end
def max_assertions
Integer(cop_config.fetch('Max', 3))
end