Sha256: 7d6ab40bb905f0aaafdcc9c18cdd2a05412094ccfa7a2f06961a729eb79620a7

Contents?: true

Size: 1.03 KB

Versions: 32

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
require 'spec_helper'
require 'integration/coolio/spec_helper'

describe "AMQ::Client::CoolioClient", "Tx.Commit", :nojruby => true do
  include EventedSpec::SpecHelper
  default_timeout 2
  let(:message) { "Hello, world!" }


  #
  # Examples
  #

  it "should confirm transaction completeness" do
    received_messages = []
    coolio_amqp_connect do |client|
      channel = AMQ::Client::Channel.new(client, 1)
      channel.open do
        exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
        queue = AMQ::Client::Queue.new(client, channel)

        queue.declare(false, false, false, true) do
          queue.bind(exchange)
        end

        channel.tx_select do
          queue.consume(true) do |header, payload, delivery_tag, redelivered, exchange, routing_key, message_count|
            received_messages << message
            done
          end

          exchange.publish(message)
          channel.tx_commit
        end
      end
    end
    received_messages.should == [message]
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha35 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha34 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha33 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha32 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha31 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha30 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha29 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha28 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha27 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha26 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha25 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha24 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha23 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha22 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha21 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha20 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha19 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha18 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha17 spec/integration/coolio/tx_commit_spec.rb
amq-client-0.7.0.alpha16 spec/integration/coolio/tx_commit_spec.rb