Sha256: 8e92b9fa5779f5b1ebe7a50f47b29ce4e7084d89eb203aaca12c7e2660d4197e

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

require 'sucker_punch'
require 'sucker_punch/testing/inline'

require 'test_workers'

describe TestWorker do
  it_behaves_like "a worker"

  it { should be_a ::SuckerPunch::Job }
end

describe MultiWorker do
  context "when Sucker Punch is loaded" do
    it "defaults to the :sucker_punch adapter" do
      MultiWorker.default_adapter.should == :sucker_punch
    end
  end

  context "when using the :sucker_punch adapter" do
    before(:each) do
      TestWorker.any_instance.should_receive(:perform).once.with("foo")
    end

    it "::perform_async uses Sucker Punch" do
      TestWorker.perform_async("foo")
    end

    it "MultiWorker.enqueue uses Sucker Punch" do
      MultiWorker.enqueue(TestWorker, "foo")
    end

    it "::perform delegates to #perform" do
      TestWorker.perform("foo")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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