Skip to content

Instantly share code, notes, and snippets.

@jejacks0n
Last active August 29, 2015 14:12
Show Gist options
  • Save jejacks0n/44d65f18876ba84f7c67 to your computer and use it in GitHub Desktop.
Save jejacks0n/44d65f18876ba84f7c67 to your computer and use it in GitHub Desktop.
Sidekiq test harness misbehaves.
require 'sidekiq/testing'
require 'sidekiq_override'
Sidekiq::Testing.inline!
class MyWorker
include Sidekiq::Worker
@executed = false
cattr_accessor :executed
def perform
self.class.executed = true
end
end
describe 'MyWorker' do
it 'executes flawlessly' do
MyWorker.perform_async
expect(MyWorker.executed).to eq(true)
end
end
class Sidekiq::Processor
def execute_job(worker, cloned_args)
raise('omg')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment