Skip to content

Commit

Permalink
Merge pull request sidekiq#1943 from aprescott/enqueue-and-perform-fo…
Browse files Browse the repository at this point in the history
…r-inline

Rely on perform_one for inline testing
  • Loading branch information
mperham committed Dec 18, 2014
2 parents 50f9575 + 03fb5f2 commit cf83436
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/sidekiq/testing.rb
Expand Up @@ -66,12 +66,11 @@ def raw_push(payloads)
end
true
elsif Sidekiq::Testing.inline?
payloads.each do |item|
jid = item['jid'] || SecureRandom.hex(12)
marshalled = Sidekiq.load_json(Sidekiq.dump_json(item))
worker = marshalled['class'].constantize.new
worker.jid = jid
worker.perform(*marshalled['args'])
payloads.each do |job|
job['jid'] ||= SecureRandom.hex(12)
klass = job['class'].constantize
klass.jobs.unshift Sidekiq.load_json(Sidekiq.dump_json(job))
klass.perform_one
end
true
else
Expand Down

0 comments on commit cf83436

Please sign in to comment.