This repository has been archived by the owner on Sep 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Queue#status should push the queue onto declare-ok 'wait list', fixes #…
- Loading branch information
1 parent
7624dc4
commit 5118012
Showing
3 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# encoding: utf-8 | ||
|
||
require 'spec_helper' | ||
|
||
describe AMQP::Queue do | ||
|
||
# | ||
# Environment | ||
# | ||
|
||
include EventedSpec::AMQPSpec | ||
|
||
default_timeout 5 | ||
|
||
|
||
|
||
# | ||
# Examples | ||
# | ||
|
||
describe "#status" do | ||
it "yields # of messages & consumers to the callback" do | ||
events = [] | ||
channel = AMQP::Channel.new | ||
|
||
queue1 = channel.queue("", :auto_delete => true) | ||
queue2 = channel.queue("amqpgem.tests.a.named.queue", :auto_delete => true) | ||
|
||
EventMachine.add_timer(1.0) do | ||
queue1.status do |m, c| | ||
events << :queue1_declare_ok | ||
end | ||
queue2.status do |m, c| | ||
events << :queue2_declare_ok | ||
end | ||
end | ||
|
||
done(2.0) { | ||
events.should include(:queue1_declare_ok) | ||
events.should include(:queue2_declare_ok) | ||
} | ||
end | ||
end | ||
end |