From b9befd3f2e69f37bfbc1395d24fcd0b79c7a7965 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Sun, 24 May 2020 21:00:13 +0200 Subject: [PATCH] Remove default configuration from specs After https://github.com/rubocop-hq/rubocop/pull/7970, all specs with the `:config` metadata by default use the default configuration. So now, there is often no reason to add a cop's default configuration in specs. --- spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb | 2 -- spec/rubocop/cop/rspec/empty_line_after_example_spec.rb | 2 -- spec/rubocop/cop/rspec/example_wording_spec.rb | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb b/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb index 6626e1bc1..d6851b833 100644 --- a/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb +++ b/spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb @@ -3,8 +3,6 @@ RSpec.describe RuboCop::Cop::RSpec::Capybara::FeatureMethods, :config do subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'EnabledMethods' => [] } } - it 'flags violations for `background`' do expect_offense(<<-RUBY) describe 'some feature' do diff --git a/spec/rubocop/cop/rspec/empty_line_after_example_spec.rb b/spec/rubocop/cop/rspec/empty_line_after_example_spec.rb index 98610504f..35af6b805 100644 --- a/spec/rubocop/cop/rspec/empty_line_after_example_spec.rb +++ b/spec/rubocop/cop/rspec/empty_line_after_example_spec.rb @@ -3,8 +3,6 @@ RSpec.describe RuboCop::Cop::RSpec::EmptyLineAfterExample, :config do subject(:cop) { described_class.new(config) } - let(:cop_config) { { 'AllowConsecutiveOneLiners' => true } } - it 'flags a missing empty line after `it`' do expect_offense(<<-RUBY) RSpec.describe Foo do diff --git a/spec/rubocop/cop/rspec/example_wording_spec.rb b/spec/rubocop/cop/rspec/example_wording_spec.rb index 1b3720916..0248dce33 100644 --- a/spec/rubocop/cop/rspec/example_wording_spec.rb +++ b/spec/rubocop/cop/rspec/example_wording_spec.rb @@ -6,8 +6,7 @@ context 'with configuration' do let(:cop_config) do { - 'CustomTransform' => { 'have' => 'has' }, - 'IgnoredWords' => %w[only really] + 'IgnoredWords' => %w[only really] } end