1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

rename shift_and_perform to perform_one

This commit is contained in:
awaw 2013-05-31 00:28:47 +08:00
parent db746b9bf8
commit ad4a0b9c93
3 changed files with 5 additions and 3 deletions

View file

@ -7,6 +7,8 @@ HEAD
Sidekiq::Job#enqueued\_at to query the time. [mariovisic, #944]
- Add Sidekiq::Queue#latency - calculates diff between now and
enqueued\_at for the oldest job in the queue.
- Add testing method `perform_one` that dequeues and performs a single job.
This is mainly to aid testing jobs that spawn other jobs. [fumin, #963]
2.12.0
-----------

View file

@ -89,7 +89,7 @@ module Sidekiq
end
# Pop out a single job and perform it
def shift_and_perform
def perform_one
job = jobs.shift
new.perform(*job['args'])
end

View file

@ -119,12 +119,12 @@ class TestTesting < Minitest::Test
StoredWorker.clear
end
it 'shift_and_perform runs only one job' do
it 'perform_one runs only one job' do
DirectWorker.perform_async(1, 2)
DirectWorker.perform_async(3, 4)
assert_equal 2, DirectWorker.jobs.size
DirectWorker.shift_and_perform
DirectWorker.perform_one
assert_equal 1, DirectWorker.jobs.size
DirectWorker.clear