Skip to content

Commit

Permalink
appease rubocop complaining about spacing
Browse files Browse the repository at this point in the history
 * no idea why it started now
  • Loading branch information
pik committed Aug 9, 2015
1 parent 9b08d93 commit 1830400
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sidekiq-unique-jobs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.require_paths = ['lib']
gem.post_install_message = 'If you are relying on `mock_redis` you will now have to add' \
'gem "mock_redis" to your desired bundler group.'
gem.version = SidekiqUniqueJobs::VERSION
gem.version = SidekiqUniqueJobs::VERSION
gem.add_dependency 'sidekiq', '>= 2.6'
gem.add_development_dependency 'mock_redis'
gem.add_development_dependency 'rspec', '~> 3.1.0'
Expand Down
18 changes: 9 additions & 9 deletions spec/lib/client/middleware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ def perform(_)

it 'does not push duplicate messages when configured for unique only' do
QueueWorker.sidekiq_options unique: true
10.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
10.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
result = Sidekiq.redis { |c| c.llen('queue:customqueue') }
expect(result).to eq 1
end

it 'does push duplicate messages to different queues' do
QueueWorker.sidekiq_options unique: true
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue2', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue2', 'args' => [1, 2])
q1_length = Sidekiq.redis { |c| c.llen('queue:customqueue') }
q2_length = Sidekiq.redis { |c| c.llen('queue:customqueue2') }
expect(q1_length).to eq 1
Expand Down Expand Up @@ -107,7 +107,7 @@ def perform(_)
it 'sets an expiration when provided by sidekiq options' do
one_hour_expiration = 60 * 60
QueueWorker.sidekiq_options unique: true, unique_job_expiration: one_hour_expiration
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2])

payload_hash = SidekiqUniqueJobs.get_payload('QueueWorker', 'customqueue', [1, 2])
actual_expires_at = Sidekiq.redis { |c| c.ttl(payload_hash) }
Expand All @@ -118,7 +118,7 @@ def perform(_)

it 'does push duplicate messages when not configured for unique only' do
QueueWorker.sidekiq_options unique: false
10.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
10.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
expect(Sidekiq.redis { |c| c.llen('queue:customqueue') }).to eq 10

result = Sidekiq.redis { |c| c.llen('queue:customqueue') }
Expand Down Expand Up @@ -180,8 +180,8 @@ class QueueWorkerWithFilterProc < QueueWorker
before { QueueWorker.sidekiq_options unique: true, unique_on_all_queues: true }
before { QueueWorker.sidekiq_options unique: true }
it 'does not push duplicate messages on different queues' do
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue2', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2])
Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue2', 'args' => [1, 2])
q1_length = Sidekiq.redis { |c| c.llen('queue:customqueue') }
q2_length = Sidekiq.redis { |c| c.llen('queue:customqueue2') }
expect(q1_length).to eq 1
Expand Down Expand Up @@ -213,7 +213,7 @@ class QueueWorkerWithFilterProc < QueueWorker

QueueWorker.sidekiq_options unique: true, log_duplicate_payload: true

2.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
2.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
result = Sidekiq.redis { |c| c.llen('queue:customqueue') }
expect(result).to eq 1
end
Expand All @@ -223,7 +223,7 @@ class QueueWorkerWithFilterProc < QueueWorker

QueueWorker.sidekiq_options unique: true, log_duplicate_payload: false

2.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
2.times { Sidekiq::Client.push('class' => QueueWorker, 'queue' => 'customqueue', 'args' => [1, 2]) }
result = Sidekiq.redis { |c| c.llen('queue:customqueue') }
expect(result).to eq 1
end
Expand Down

0 comments on commit 1830400

Please sign in to comment.