diff --git a/spec/rubocop/cli/autocorrect_spec.rb b/spec/rubocop/cli/autocorrect_spec.rb index ebe8746cf7..32a5eb66d2 100644 --- a/spec/rubocop/cli/autocorrect_spec.rb +++ b/spec/rubocop/cli/autocorrect_spec.rb @@ -7,10 +7,16 @@ include_context 'mock console output' - before do + # Restore injected config as well + around do |ex| + previous_config = RuboCop::ConfigLoader.default_configuration + RuboCop::ConfigLoader.default_configuration = nil RuboCop::ConfigLoader.default_configuration.for_all_cops['SuggestExtensions'] = false RuboCop::ConfigLoader.default_configuration.for_all_cops['NewCops'] = 'disable' + ex.call + ensure + RuboCop::ConfigLoader.default_configuration = previous_config end it 'corrects `Performance/ConstantRegexp` with `Performance/RegexpMatch`' do diff --git a/spec/rubocop/cop/performance/sum_spec.rb b/spec/rubocop/cop/performance/sum_spec.rb index 951a4f3097..fdbf2b76a8 100644 --- a/spec/rubocop/cop/performance/sum_spec.rb +++ b/spec/rubocop/cop/performance/sum_spec.rb @@ -271,10 +271,6 @@ ^{method}^^^^^ Use `sum` instead of `#{method}(&:+)`, unless calling `#{method}(&:+)` on an empty array. RUBY - # FIXME: The following failures in JRuby need to be fixed: - # https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215 - skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby' - expect_correction(<<~RUBY) array.sum RUBY @@ -286,10 +282,6 @@ ^{method}^^^^ Use `sum` instead of `#{method}(:+)`, unless calling `#{method}(:+)` on an empty array. RUBY - # FIXME: The following failures in JRuby need to be fixed: - # https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215 - skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby' - expect_correction(<<~RUBY) array.sum RUBY @@ -301,10 +293,6 @@ ^{method}^^^ Use `sum` instead of `#{method}(:+)`, unless calling `#{method}(:+)` on an empty array. RUBY - # FIXME: The following failures in JRuby need to be fixed: - # https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215 - skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby' - expect_correction(<<~RUBY) array.sum RUBY @@ -316,10 +304,6 @@ ^{method}^^^^ Use `sum` instead of `#{method}(:+)`. RUBY - # FIXME: The following failures in JRuby need to be fixed: - # https://github.com/rubocop/rubocop-performance/actions/runs/7013730884/job/19080337215 - skip('Unexpected JRuby autocorrection test failure needs to be fixed.') if RUBY_ENGINE == 'jruby' - expect_correction(<<~RUBY) [1, 2, 3].sum RUBY