lib/rubocop/cop/rspec/multiple_expectations.rb in rubocop-rspec-2.31.0 vs lib/rubocop/cop/rspec/multiple_expectations.rb in rubocop-rspec-3.0.0.pre
- old
+ new
@@ -70,11 +70,11 @@
include ConfigurableMax
MSG = 'Example has too many expectations [%<total>d/%<max>d].'
ANYTHING = ->(_node) { true }
- TRUE = lambda(&:true_type?)
+ TRUE_NODE = lambda(&:true_type?)
# @!method aggregate_failures?(node)
def_node_matcher :aggregate_failures?, <<~PATTERN
(block {
(send _ _ <(sym :aggregate_failures) ...>)
@@ -108,10 +108,10 @@
def example_with_aggregate_failures?(example_node)
node_with_aggregate_failures = find_aggregate_failures(example_node)
return false unless node_with_aggregate_failures
- aggregate_failures?(node_with_aggregate_failures, TRUE)
+ aggregate_failures?(node_with_aggregate_failures, TRUE_NODE)
end
def find_aggregate_failures(example_node)
example_node.send_node.each_ancestor(:block)
.find { |block_node| aggregate_failures?(block_node, ANYTHING) }