Sha256: c311d92c95cf83db3293833c232f521643a158c333d04a16536fe8717f94b88b

Contents?: true

Size: 902 Bytes

Versions: 1

Compression:

Stored size: 902 Bytes

Contents

exit unless jruby?

require 'torquebox/messaging'
require 'torquebox/messaging/backgroundable'
require 'torquebox/core'
#java_import 'org.torquebox.core.util.StringUtils'

require 'test_workers'

describe TestWorker do
  it_behaves_like "a worker"

  it { should be_a ::TorqueBox::Messaging::Backgroundable}
end

describe MultiWorker do
  context "when TorqueBox::Messaging::Backgroundable is loaded" do
    it "defaults to the :sidekiq adapter" do
      expect(MultiWorker.default_adapter).to eq(:torquebox_backgroundable)
    end
  end

  context "when using the :torquebox_backgroundable adapter" do
    it "puts a message on the queue" do
      #@queue.should_receive(:publish).exactly(2).times
      expect(TorqueBox::Messaging::Backgroundable::Util).to receive(:publish_message).exactly(2).times
      TestWorker.perform_async("foo")
      MultiWorker.enqueue(TestWorker, "foo")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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