Sha256: df606a2b3012b9310ad7ceb1131619d24ecc11fc4c496d82b1aad1d81b2bba3c
Contents?: true
Size: 1.81 KB
Versions: 1
Compression:
Stored size: 1.81 KB
Contents
require "spec_helper" describe Bunny::Exchange, "#delete" 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 if connection.open? end context "with a name of an existing exchange" do it "deletes that exchange" do ch = connection.create_channel x = ch.fanout("bunny.tests.exchanges.fanout#{rand}") x.delete expect { x.delete }.to raise_error(Bunny::NotFound) end end context "with a name of a non-existent exchange" do it "raises an exception" do ch = connection.create_channel expect { ch.exchange_delete("sdkhflsdjflskdjflsd#{rand}") }.to raise_error(Bunny::NotFound) end end context "with a name of 'amq.direct'" do it "does not delete the exchange" do ch = connection.create_channel x = ch.direct('amq.direct') x.delete.should == nil end end context "with a name of 'amq.fanout'" do it "does not delete the exchange" do ch = connection.create_channel x = ch.fanout('amq.fanout') x.delete.should == nil end end context "with a name of 'amq.topic'" do it "does not delete the exchange" do ch = connection.create_channel x = ch.topic('amq.topic') x.delete.should == nil end end context "with a name of 'amq.headers'" do it "does not delete the exchange" do ch = connection.create_channel x = ch.headers('amq.headers') x.delete.should == nil end end context "with a name of 'amq.match'" do it "does not delete the exchange" do ch = connection.create_channel x = ch.headers('amq.match') x.delete.should == nil end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bunny-0.9.0.pre4 | spec/higher_level_api/integration/exchange_delete_spec.rb |