Sha256: a2e9f678be3725d882ad89ec26941eff481f4e87a5e053157fd2a16412fc543e
Contents?: true
Size: 1.32 KB
Versions: 4
Compression:
Stored size: 1.32 KB
Contents
# encoding: utf-8 require 'spec_helper' require 'integration/eventmachine/spec_helper' describe AMQ::Client::EventMachineClient, "Basic.Cancel" do include EventedSpec::SpecHelper default_timeout 4 let(:messages) { (0..99).map {|i| "Message #{i}" } } it "should stop receiving messages after receiving cancel-ok" do @received_messages = [] em_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") exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout) queue.consume(true) do |amq_method| queue.on_delivery do |method, header, payload| @received_messages << payload end messages.each do |message| exchange.publish(message) end end delayed(1.5) { @received_messages.should =~ messages queue.cancel do exchange.publish("Extra message, should not be received") end } done(2.5) { @received_messages.should =~ messages } end end end # it "should stop receiving messages after receiving cancel-ok" end # describe AMQ::Client::EventMachineClient, "Basic.Consume"
Version data entries
4 entries across 4 versions & 1 rubygems