Sha256: 6a071f9c7138d4949465697e6692c35f219ca280dcd27f14f86eaccd23999cda

Contents?: true

Size: 830 Bytes

Versions: 1

Compression:

Stored size: 830 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
      expect(MultiWorker.default_adapter).to eq(:sucker_punch)
    end
  end

  context "when using the :sucker_punch adapter" do
    before(:each) do
      expect_any_instance_of(TestWorker).to 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.2.0 spec/adapters/sucker_punch_spec.rb