Sha256: 8fd59f6059fb88ecf118084551dd1c2ab5111c183d480e670a6ec435959f0063

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

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 queue" 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 an existing exchange" do
    it "raises an exception" do
      ch = connection.create_channel

      expect {
        ch.exchange_delete("sdkhflsdjflskdjflsd#{rand}")
      }.to raise_error(Bunny::NotFound)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bunny-0.9.0.pre3 spec/higher_level_api/integration/exchange_delete_spec.rb
bunny-0.9.0.pre2 spec/higher_level_api/integration/exchange_delete_spec.rb
bunny-0.9.0.pre1 spec/higher_level_api/integration/exchange_delete_spec.rb