Sha256: d1cf0a587d4c68cc2abbbf60bd2203cf78a93288a3eb62a69b4bfc688a2528e5

Contents?: true

Size: 693 Bytes

Versions: 1

Compression:

Stored size: 693 Bytes

Contents

require 'qu'
require 'qu-immediate'

require 'test_workers'

describe TestWorker do
  it_behaves_like "a worker"
end

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

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

    it "exposes the Qu rake task" do
      expect(MultiWorker.adapter.rake_task.name).to eq("qu:work")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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