Sha256: b595dbb15be1387bec4cbfc35c57128b58a7cad0a78d06ce2e215941f7706b67

Contents?: true

Size: 1.09 KB

Versions: 32

Compression:

Stored size: 1.09 KB

Contents

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

describe "AMQ::Client::CoolioClient", "Tx.Rollback", :nojruby => true do
  include EventedSpec::SpecHelper
  default_timeout 2

  let(:message) { "Hello, world!" }



  #
  # Examples
  #


  it "should cancel all the changes done during transaction" do
    pending("Need to figure out details with AMQP protocol on that matter")
    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
          done(0.1)
          queue.consume(true) do |method, header, message|
            received_messages << message unless message.nil?
          end

          exchange.publish(message)
          channel.tx_rollback
        end
      end
    end

    received_messages.should == []
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha15 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha14 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha13 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha12 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha11 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha10 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha9 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha8 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha7 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha6 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha5 spec/integration/coolio/tx_rollback_spec.rb
amq-client-0.7.0.alpha4 spec/integration/coolio/tx_rollback_spec.rb