Sha256: eef72f879742d9ca081e4509970cb8b1229b33377ad6662bbdc98978bf681535

Contents?: true

Size: 874 Bytes

Versions: 2

Compression:

Stored size: 874 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.2.0 spec/rosetta_queue/adapters/shared_adapter_behavior.rb
cwyckoff-rosetta_queue-0.3.3 spec/rosetta_queue/adapters/shared_adapter_behavior.rb