lib/rubocop/cop/rspec/multiple_expectations.rb in rubocop-rspec-1.20.1 vs lib/rubocop/cop/rspec/multiple_expectations.rb in rubocop-rspec-1.21.0
- old
+ new
@@ -77,11 +77,12 @@
private
def example_with_aggregated_failures?(node)
example = node.children.first
- with_aggregated_failures?(example) &&
+ (aggregated_failures_by_default? ||
+ with_aggregated_failures?(example)) &&
!disabled_aggregated_failures?(example)
end
def find_expectation(node, &block)
yield if expect?(node) || aggregate_failures?(node)
@@ -108,9 +109,13 @@
)
end
def max_expectations
Integer(cop_config.fetch('Max', 1))
+ end
+
+ def aggregated_failures_by_default?
+ cop_config.fetch('AggregateFailuresByDefault', false)
end
end
end
end
end