Sha256: 568c8e9d899666d743fd0b6d77ec764e3d05ed74d4cdf4db079fd16523d53574

Contents?: true

Size: 565 Bytes

Versions: 8

Compression:

Stored size: 565 Bytes

Contents

module RosettaQueue
  module Gateway
    
    class FakeAdapter

      def initialize
        @messages = []
      end

      def send_message(queue, message, headers)
        @messages << {'queue' => queue, 'message' => RosettaQueue::Filters::process_receiving(message), 'headers' => headers}
      end
  
      def messages_sent_to(queue)
        (queue ? @messages.select{|message| message['queue'] == queue} : @messages).map{|m| m['message']}
      end
  
      def queues
        @messages.map {|message| message['queue']}
      end

    end
    
  end
  
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
bmabey-rosetta_queue-0.1.3 lib/rosetta_queue/adapters/fake.rb
bmabey-rosetta_queue-0.2.0 lib/rosetta_queue/adapters/fake.rb
cwyckoff-rosetta_queue-0.1.4 lib/rosetta_queue/adapters/fake.rb
cwyckoff-rosetta_queue-0.2.0 lib/rosetta_queue/adapters/fake.rb
cwyckoff-rosetta_queue-0.2.1 lib/rosetta_queue/adapters/fake.rb
cwyckoff-rosetta_queue-0.2.2 lib/rosetta_queue/adapters/fake.rb
cwyckoff-rosetta_queue-0.3.0 lib/rosetta_queue/adapters/fake.rb
cwyckoff-rosetta_queue-0.3.3 lib/rosetta_queue/adapters/fake.rb