Sha256: 1347f94ed2bb3f5817a51a7ad66c1a5a416475ad716c96629ff23d93eb65cc44

Contents?: true

Size: 870 Bytes

Versions: 13

Compression:

Stored size: 870 Bytes

Contents

require "spec_helper"

describe Bunny::Exchange do
  let(:connection) do
    c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
    c.start
    c
  end

  after :each do
    connection.close if connection.open?
  end

  it "unbinds two existing exchanges" do
    ch          = connection.create_channel

    source      = ch.fanout("bunny.exchanges.source#{rand}")
    destination = ch.fanout("bunny.exchanges.destination#{rand}")

    queue       = ch.queue("", :exclusive => true)
    queue.bind(destination)

    destination.bind(source)
    source.publish("")
    sleep 0.5

    queue.message_count.should be == 1
    queue.pop(:manual_ack => true)

    destination.unbind(source)
    source.publish("")
    sleep 0.5

    queue.message_count.should be == 0

    source.delete
    destination.delete
    ch.close
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bunny-1.7.1 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.7.0 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.3 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.2 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.1 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.0 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.5.1 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.0.rc2 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.0.rc1 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.6.0.pre1 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.5.0 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.5.0.pre2 spec/higher_level_api/integration/exchange_unbind_spec.rb
bunny-1.5.0.pre1 spec/higher_level_api/integration/exchange_unbind_spec.rb