Fix RSpec/HookArgument rubocop offense

This commit is contained in:
Semyon Pupkov 2018-12-11 11:29:58 +05:00
parent 185f8a5da6
commit db267fa31b
5 changed files with 8 additions and 19 deletions

View File

@ -155,17 +155,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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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