summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/exclusive_lease_helpers_spec.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-07-04 13:28:18 +0900
committerShinya Maeda <shinya@gitlab.com>2018-07-04 13:28:18 +0900
commit202c2c6aef9a15c50921f3fe2c2166384b8dd321 (patch)
treef09203ca462eb0c1ede8ff6ba5e6fa6402313049 /spec/lib/gitlab/exclusive_lease_helpers_spec.rb
parentf11aa51eeaa7a8175a9075ba95038c675ef9a8a6 (diff)
downloadgitlab-ce-202c2c6aef9a15c50921f3fe2c2166384b8dd321.tar.gz
Fix static analysys
Diffstat (limited to 'spec/lib/gitlab/exclusive_lease_helpers_spec.rb')
-rw-r--r--spec/lib/gitlab/exclusive_lease_helpers_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/lib/gitlab/exclusive_lease_helpers_spec.rb b/spec/lib/gitlab/exclusive_lease_helpers_spec.rb
index eb2143f9d1d..2e3656b52fb 100644
--- a/spec/lib/gitlab/exclusive_lease_helpers_spec.rb
+++ b/spec/lib/gitlab/exclusive_lease_helpers_spec.rb
@@ -9,7 +9,7 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
describe '#in_lock' do
subject { class_instance.in_lock(unique_key, **options) { } }
- let(:options) { { } }
+ let(:options) { {} }
context 'when the lease is not obtained yet' do
before do
@@ -43,11 +43,11 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
end
context 'when ttl is specified' do
- let(:options) { { ttl: 10.minute } }
+ let(:options) { { ttl: 10.minutes } }
it 'receives the specified argument' do
- expect(Gitlab::ExclusiveLease).to receive(:new).with(unique_key, { timeout: 10.minute } )
-
+ expect(Gitlab::ExclusiveLease).to receive(:new).with(unique_key, { timeout: 10.minutes } )
+
expect { subject }.to raise_error('Failed to obtain a lock')
end
end
@@ -57,17 +57,17 @@ describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do
it 'retries for the specified times' do
expect(lease).to receive(:try_obtain).exactly(4).times
-
+
expect { subject }.to raise_error('Failed to obtain a lock')
end
end
context 'when sleep second is specified' do
- let(:options) { { retries: 0, sleep_sec: 0.05.second } }
+ let(:options) { { retries: 0, sleep_sec: 0.05.seconds } }
it 'receives the specified argument' do
- expect(class_instance).to receive(:sleep).with(0.05.second).once
-
+ expect(class_instance).to receive(:sleep).with(0.05.seconds).once
+
expect { subject }.to raise_error('Failed to obtain a lock')
end
end