Sha256: c08e426e42b48cca55431a0dd667a2be9e61fea197dd511bc1bafd830d9d9cb1

Contents?: true

Size: 551 Bytes

Versions: 2

Compression:

Stored size: 551 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

2 entries across 2 versions & 2 rubygems

Version Path
bmabey-rosetta_queue-0.3.3 lib/rosetta_queue/adapters/fake.rb
rosetta_queue-0.4.0 lib/rosetta_queue/adapters/fake.rb