Sha256: 11556eda966fef0215d47da1689240138ddeff11e4ffdb058d8dca275a3b8183

Contents?: true

Size: 846 Bytes

Versions: 2

Compression:

Stored size: 846 Bytes

Contents

module RosettaQueue
  module Gateway

    describe "an adapter", :shared => true do

      before(:each) do
        ::RosettaQueue::Destinations.stub!(:lookup).and_return("foo")
      end

      def do_publishing
        @adapter.send_message('queue', 'message', 'options')
      end

      def do_receiving_with_handler
        @adapter.receive_with(@handler)
      end

      describe "#receive_once" do

        it "should return the message from the connection" do
          @adapter.receive_once("foo", {:persistent => false}).should == @msg
        end

      end

      describe "#receive_with" do

        it "should look up the destination defined on the class" do
          when_receiving_with_handler {
            Destinations.should_receive(:lookup).with(:foo).and_return("foo")
          }
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bmabey-rosetta_queue-0.3.3 spec/rosetta_queue/adapters/shared_adapter_behavior.rb
rosetta_queue-0.4.0 spec/rosetta_queue/adapters/shared_adapter_behavior.rb