Skip to content

Commit 074bd2a

Browse files
committedFeb 2, 2025·
Explicit default Performance/Sum cop config for the spec
If not explicitly specified, it depends on `config/default.yml`, which is the result of configuration file loading as a side effect of the Inject mechanism.
1 parent 349ae04 commit 074bd2a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎spec/rubocop/cop/performance/sum_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::Performance::Sum, :config do
4+
let(:cop_config) { { 'SafeAutoCorrect' => false, 'OnlySumOrWithInitialValue' => false } }
5+
46
%i[inject reduce].each do |method|
57
it "registers an offense and corrects when using `array.#{method}(10, :+)`" do
68
expect_offense(<<~RUBY, method: method)

0 commit comments

Comments
 (0)
Please sign in to comment.