spec/tasks/dispatcher_spec.rb in volt-0.9.3.pre4 vs spec/tasks/dispatcher_spec.rb in volt-0.9.3.pre5

- old
+ new

@@ -5,15 +5,22 @@ def allowed_method(arg1, arg2) 'yes' + arg1 + arg2 end end + class WorkerPoolStub + def post(*args) + yield(*args) + end + end + describe Volt::Dispatcher do + let(:dispatcher) { Volt::Dispatcher.new(Volt.current_app) } + before do Volt.logger = spy('Volt::VoltLogger') + allow(Concurrent::ThreadPoolExecutor).to receive(:new).and_return(WorkerPoolStub.new) end - - let(:dispatcher) { Volt::Dispatcher.new(Volt.current_app) } after do # Cleanup, make volt make a new logger. Otherwise this will leak out. Volt.logger = nil end