Commit d8c42522 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-rspec-offcense' into 'master'

Fix RSpec/HookArgument rubocop offense

See merge request gitlab-org/gitlab-ce!23776
parents 8b460204 db267fa3
...@@ -149,17 +149,6 @@ RSpec/ExpectChange: ...@@ -149,17 +149,6 @@ RSpec/ExpectChange:
RSpec/ExpectInHook: RSpec/ExpectInHook:
Enabled: false 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 # Offense count: 19
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
# SupportedStyles: it_behaves_like, it_should_behave_like # SupportedStyles: it_behaves_like, it_should_behave_like
......
...@@ -115,7 +115,7 @@ RSpec.configure do |config| ...@@ -115,7 +115,7 @@ RSpec.configure do |config|
TestEnv.clean_test_path TestEnv.clean_test_path
end end
config.before(:example) do config.before do
# Enable all features by default for testing # Enable all features by default for testing
allow(Feature).to receive(:enabled?) { true } allow(Feature).to receive(:enabled?) { true }
...@@ -136,11 +136,11 @@ RSpec.configure do |config| ...@@ -136,11 +136,11 @@ RSpec.configure do |config|
RequestStore.clear! RequestStore.clear!
end end
config.after(:example) do config.after do
Fog.unmock! if Fog.mock? Fog.unmock! if Fog.mock?
end end
config.after(:example) do config.after do
Gitlab::CurrentSettings.clear_in_memory_application_settings! Gitlab::CurrentSettings.clear_in_memory_application_settings!
end end
......
CarrierWave.root = File.expand_path('tmp/tests/public', Rails.root) CarrierWave.root = File.expand_path('tmp/tests/public', Rails.root)
RSpec.configure do |config| RSpec.configure do |config|
config.after(:each) do config.after do
FileUtils.rm_rf(CarrierWave.root) FileUtils.rm_rf(CarrierWave.root)
end end
end end
...@@ -23,7 +23,7 @@ RSpec.configure do |config| ...@@ -23,7 +23,7 @@ RSpec.configure do |config|
DatabaseCleaner.clean_with(:deletion, cache_tables: false) DatabaseCleaner.clean_with(:deletion, cache_tables: false)
end end
config.before(:each) do config.before do
DatabaseCleaner.strategy = :transaction DatabaseCleaner.strategy = :transaction
end end
...@@ -39,11 +39,11 @@ RSpec.configure do |config| ...@@ -39,11 +39,11 @@ RSpec.configure do |config|
DatabaseCleaner.strategy = :deletion, { cache_tables: false } DatabaseCleaner.strategy = :deletion, { cache_tables: false }
end end
config.before(:each) do config.before do
DatabaseCleaner.start DatabaseCleaner.start
end end
config.append_after(:each) do config.append_after do
DatabaseCleaner.clean DatabaseCleaner.clean
end end
end end
...@@ -11,7 +11,7 @@ RSpec.configure do |config| ...@@ -11,7 +11,7 @@ RSpec.configure do |config|
FileUtils.mkdir_p(builds_path) FileUtils.mkdir_p(builds_path)
end end
config.before(:each) do config.before do
FileUtils.rm_rf(builds_path) FileUtils.rm_rf(builds_path)
FileUtils.mkdir_p(builds_path) FileUtils.mkdir_p(builds_path)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment