spec/integration/eventmachine/basic_cancel_spec.rb in amq-client-0.8.3 vs spec/integration/eventmachine/basic_cancel_spec.rb in amq-client-0.8.4
- old
+ new
@@ -8,11 +8,12 @@
default_timeout 4
let(:messages) { (0..99).map {|i| "Message #{i}" } }
it "should stop receiving messages after receiving cancel-ok" do
- @received_messages = []
+ @received_messages = []
+ @received_basic_cancel_ok = false
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")
@@ -29,15 +30,17 @@
end
delayed(1.5) {
@received_messages.should =~ messages
queue.cancel do
+ @received_basic_cancel_ok = true
exchange.publish("Extra message, should not be received")
end
}
done(2.5) {
@received_messages.should =~ messages
+ @received_basic_cancel_ok.should be_true
}
end
end
end # it "should stop receiving messages after receiving cancel-ok"