Sha256: fe07798106ad879692894b28239bea33063e6a87486f5fab823c7294b005e03e

Contents?: true

Size: 1.19 KB

Versions: 15

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'
require 'integration/coolio/spec_helper'

describe "AMQ::Client::CoolioClient", "Basic.Ack", :nojruby => true do
  include EventedSpec::SpecHelper
  default_timeout 1

  context "sending 100 messages" do
    let(:messages) { (0..99).map {|i| "Message #{i}" } }

    it "should receive & acknowledge all the messages" do
      @received_messages = []
      coolio_amqp_connect do |client|
        channel = AMQ::Client::Channel.new(client, 1)
        channel.open do
          queue = AMQ::Client::Queue.new(client, channel).declare(false, false, false, true)
          queue.bind("amq.fanout")

          queue.consume do |_, consumer_tag|
            queue.on_delivery do |method, header, payload|
              queue.acknowledge(method.delivery_tag)
              @received_messages << payload
            end

            exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
            messages.each do |message|
              exchange.publish(message)
            end
          end # consume
        end # open

        done(0.8) {
          @received_messages.should =~ messages
        }
      end # coolio_amqp_connect
    end # it
  end # context
end # describe

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha35 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha34 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha33 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha32 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha31 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha30 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha29 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha28 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha27 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha26 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha25 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha24 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha23 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha22 spec/integration/coolio/basic_ack_spec.rb
amq-client-0.7.0.alpha21 spec/integration/coolio/basic_ack_spec.rb