Sha256: 8287f8f7160b7ec06e5baebf4cd37aca1e6357292d72fe010fce940bea784072

Contents?: true

Size: 875 Bytes

Versions: 1

Compression:

Stored size: 875 Bytes

Contents

require 'backburner'
require 'test_workers'

describe TestWorker do
  it_behaves_like "a worker"

  it { should be_a ::Backburner::Queue }
end

describe MultiWorker do
  context "when Backburner is loaded" do
    it "defaults to the :backburner adapter" do
      MultiWorker.default_adapter.should == :backburner
    end
  end

  context "when using the :backburner adapter" do
    it "::perform_async uses Backburner" do
      Backburner.should_receive(:enqueue).once.with(TestWorker, "foo")
      TestWorker.perform_async("foo")
    end

    it "MultiWorker.enqueue uses Backburner" do
      Backburner.should_receive(:enqueue).once.with(TestWorker, "foo")
      MultiWorker.enqueue(TestWorker, "foo")
    end

    it "exposes the Backburner rake task" do
      MultiWorker.adapter.rake_task.name.should == "backburner:work"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
multi_worker-0.1.0 spec/adapters/backburner_spec.rb