Sha256: da3a9eba4f2cf0bc6a99c9f002550db674da3dceee6c39f9f83c8524e808d3da

Contents?: true

Size: 710 Bytes

Versions: 1

Compression:

Stored size: 710 Bytes

Contents

require 'threaded_in_memory_queue'
ThreadedInMemoryQueue.inline = true

require 'test_workers'

describe TestWorker do
  it_behaves_like "a worker"
end

describe MultiWorker do
  context "when ThreadedInMemoryQueue is loaded" do
    it "defaults to the :threaded_in_memory_queue adapter" do
      expect(MultiWorker.default_adapter).to eq(:threaded_in_memory_queue)
    end
  end

  context "when using the :threaded_in_memory_queue adapter" do
    it "performs the work using ThreadedInMemoryQueue" do
      expect(TestWorker).to receive(:perform).exactly(3).times.with("foo")
      TestWorker.perform_async("foo")
      MultiWorker.enqueue(TestWorker, "foo")
      TestWorker.perform("foo")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_worker-0.2.0 spec/adapters/threaded_in_memory_queue_spec.rb