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

34 lines
743 B
Ruby
Raw Normal View History

2015-10-02 18:44:29 -04:00
require_relative 'helper'
require 'sidekiq/fetch'
class TestActors < Sidekiq::Test
class SomeWorker
include Sidekiq::Worker
end
describe 'fetcher' do
it 'can start and stop' do
f = Sidekiq::Fetcher.new(nil, { queues: ['default'] })
f.start
f.terminate
end
it 'can fetch' do
SomeWorker.perform_async
mgr = Minitest::Mock.new
mgr.expect(:assign, nil, [Sidekiq::BasicFetch::UnitOfWork])
mgr.expect(:assign, nil, [Sidekiq::BasicFetch::UnitOfWork])
f = Sidekiq::Fetcher.new(mgr, { queues: ['default'] })
f.start
f.request_job
sleep 0.001
f.terminate
mgr.verify
#assert_equal Sidekiq::BasicFetch::UnitOfWork, job.class
end
end
end