RSpec.shared_context 'type_worker', type: :worker do
  before do
    out = double(:out, puts: nil, flush: nil)
    task = build(:task)
    allow(worker).to receive(:call).and_yield(out, task)
    worker.out = out
  end
end