summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-12-17 09:47:48 +0000
committerRémy Coutable <remy@rymai.me>2018-12-17 09:47:48 +0000
commitd8c425227320d8b4ca2e5b31125a236889d72043 (patch)
treeaacebe81332dd6106f61fb8277e829f9312c7c82
parent8b4602041cf2c4a8738a4796d78720017249249f (diff)
parentdb267fa31bcbf991a2efb932b85a8935a13b0941 (diff)
downloadgitlab-ce-d8c425227320d8b4ca2e5b31125a236889d72043.tar.gz
Merge branch 'fix-rspec-offcense' into 'master'
Fix RSpec/HookArgument rubocop offense See merge request gitlab-org/gitlab-ce!23776
-rw-r--r--.rubocop_todo.yml11
-rw-r--r--spec/spec_helper.rb6
-rw-r--r--spec/support/carrierwave.rb2
-rw-r--r--spec/support/db_cleaner.rb6
-rw-r--r--spec/support/setup_builds_storage.rb2
5 files changed, 8 insertions, 19 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 3ab76965287..847a0f74aa2 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -149,17 +149,6 @@ RSpec/ExpectChange:
RSpec/ExpectInHook:
Enabled: false
-# Offense count: 7
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: implicit, each, example
-RSpec/HookArgument:
- Exclude:
- - 'spec/spec_helper.rb'
- - 'spec/support/carrierwave.rb'
- - 'spec/support/db_cleaner.rb'
- - 'spec/support/gitaly.rb'
- - 'spec/support/setup_builds_storage.rb'
-
# Offense count: 19
# Configuration parameters: EnforcedStyle.
# SupportedStyles: it_behaves_like, it_should_behave_like
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index cd69160be10..fb3421b61d3 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -115,7 +115,7 @@ RSpec.configure do |config|
TestEnv.clean_test_path
end
- config.before(:example) do
+ config.before do
# Enable all features by default for testing
allow(Feature).to receive(:enabled?) { true }
@@ -136,11 +136,11 @@ RSpec.configure do |config|
RequestStore.clear!
end
- config.after(:example) do
+ config.after do
Fog.unmock! if Fog.mock?
end
- config.after(:example) do
+ config.after do
Gitlab::CurrentSettings.clear_in_memory_application_settings!
end
diff --git a/spec/support/carrierwave.rb b/spec/support/carrierwave.rb
index b4b016e408f..b376822d530 100644
--- a/spec/support/carrierwave.rb
+++ b/spec/support/carrierwave.rb
@@ -1,7 +1,7 @@
CarrierWave.root = File.expand_path('tmp/tests/public', Rails.root)
RSpec.configure do |config|
- config.after(:each) do
+ config.after do
FileUtils.rm_rf(CarrierWave.root)
end
end
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb
index 5edc5de2a09..34b9efaaecd 100644
--- a/spec/support/db_cleaner.rb
+++ b/spec/support/db_cleaner.rb
@@ -23,7 +23,7 @@ RSpec.configure do |config|
DatabaseCleaner.clean_with(:deletion, cache_tables: false)
end
- config.before(:each) do
+ config.before do
DatabaseCleaner.strategy = :transaction
end
@@ -39,11 +39,11 @@ RSpec.configure do |config|
DatabaseCleaner.strategy = :deletion, { cache_tables: false }
end
- config.before(:each) do
+ config.before do
DatabaseCleaner.start
end
- config.append_after(:each) do
+ config.append_after do
DatabaseCleaner.clean
end
end
diff --git a/spec/support/setup_builds_storage.rb b/spec/support/setup_builds_storage.rb
index 2e7c88bfc09..1d2a4856724 100644
--- a/spec/support/setup_builds_storage.rb
+++ b/spec/support/setup_builds_storage.rb
@@ -11,7 +11,7 @@ RSpec.configure do |config|
FileUtils.mkdir_p(builds_path)
end
- config.before(:each) do
+ config.before do
FileUtils.rm_rf(builds_path)
FileUtils.mkdir_p(builds_path)
end