Sha256: ee7bac953a3ce73fcb6b3c6b770c8968d582aaeb2c372eb9672e4a8fa629e141
Contents?: true
Size: 1.06 KB
Versions: 15
Compression:
Stored size: 1.06 KB
Contents
require "spec_helper" describe Bunny::Queue, "bound to an exchange" do let(:connection) do c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed") c.start c end after :all do connection.close end it "can be unbound from an exchange it was bound to" do ch = connection.create_channel x = ch.fanout("amq.fanout") q = ch.queue("", :exclusive => true).bind(x) x.publish("") sleep 0.3 q.message_count.should == 1 q.unbind(x) x.publish("") q.message_count.should == 1 end end describe Bunny::Queue, "NOT bound to an exchange" do let(:connection) do c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed") c.start c end after :all do connection.close end it "cannot be unbound (raises a channel error)" do ch = connection.create_channel x = ch.fanout("amq.fanout") q = ch.queue("", :exclusive => true) lambda { q.unbind(x) }.should raise_error(Bunny::NotFound, /no binding/) end end
Version data entries
15 entries across 15 versions & 1 rubygems