Sha256: b8e970216a833b2aca674c83430bfabbe58f7ee2b3136b9d28901a43e2eca7ed

Contents?: true

Size: 1.08 KB

Versions: 32

Compression:

Stored size: 1.08 KB

Contents

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

describe AMQ::Client::EventMachineClient, "Tx.Rollback" do
  include EventedSpec::SpecHelper
  default_timeout 4
  let(:message) { "Hello, world!" }
  it "should cancel all the changes done during transaction" do
    pending("Need to figure out details with AMQP protocol on that matter")
    received_messages = []
    em_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 |header, payload, delivery_tag, redelivered, exchange, routing_key, message_count|
            received_messages << message
          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-1.0.4 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.0.3 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.1.0.pre1 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.0.2 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.0.1 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.0.0 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.12 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.11 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.10 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.9 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.8 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.7 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.6 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.5 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.4 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.0.0.pre2 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.3 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-1.0.0.pre1 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.2 spec/integration/eventmachine/tx_rollback_spec.rb
amq-client-0.9.1 spec/integration/eventmachine/tx_rollback_spec.rb