Sha256: 919e31e7ba602820bb10e4e088ab2279b214da287ed462fbb93cbfae79f17cd7
Contents?: true
Size: 1.28 KB
Versions: 2
Compression:
Stored size: 1.28 KB
Contents
require 'spec_helper' describe Hawkei::Processor::Async do let(:processor) { Hawkei::Processor::Async.new } context 'enqueue a message' do before do allow(processor).to receive(:ensure_worker_running) processor.enqueue({ test: 'hello' }) end it { expect(processor).to have_received(:ensure_worker_running) } it { expect(processor.instance_variable_get(:@queue).length).to eq(1) } end context 'shutting down worker' do before do allow_message_expectations_on_nil allow(processor.instance_variable_get(:@state_worker)).to receive(:make_false) allow(processor.instance_variable_get(:@worker_thread)).to receive(:wait) allow(Concurrent.global_io_executor).to receive(:shutdown) allow(Concurrent.global_io_executor).to receive(:wait_for_termination) processor.send(:shutdown_worker) end it { expect(processor.instance_variable_get(:@state_worker)).to have_received(:make_false) } it { expect(processor.instance_variable_get(:@worker_thread)).to have_received(:wait) } it { expect(Concurrent.global_io_executor).to have_received(:shutdown) } it { expect(Concurrent.global_io_executor).to have_received(:wait_for_termination) } it { expect(processor.instance_variable_get(:@queue).length).to eq(1) } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hawkei-1.1.0 | spec/lib/hawkei/processor/async_spec.rb |
hawkei-1.0.0 | spec/lib/hawkei/processor/async_spec.rb |