Implement Runner#worker
This commit is contained in:
@@ -122,6 +122,27 @@ module Uh
|
||||
end
|
||||
end
|
||||
|
||||
describe '#worker' do
|
||||
it 'returns a worker' do
|
||||
expect(runner.worker).to respond_to :work_events
|
||||
end
|
||||
|
||||
it 'setups the read callback to tell manager to handle pending events' do
|
||||
expect(runner.manager).to receive :handle_pending_events
|
||||
runner.worker.on_read.call
|
||||
end
|
||||
|
||||
it 'setups the read_next callback to tell manager to handle next event' do
|
||||
expect(runner.manager).to receive :handle_next_event
|
||||
runner.worker.on_read_next.call
|
||||
end
|
||||
|
||||
it 'setups the timeout callback to tell manager to flush the output' do
|
||||
expect(runner.manager).to receive :flush
|
||||
runner.worker.on_timeout.call
|
||||
end
|
||||
end
|
||||
|
||||
describe '#run_until' do
|
||||
it 'tells the manager to handle events until given block is true' do
|
||||
block = proc { }
|
||||
|
Reference in New Issue
Block a user