Sha256: 4d05ff9038e911a8f6aa05b674c8a2cbf7ee873ab1da580ba1729c7ff9ea3d9b

Contents?: true

Size: 1.04 KB

Versions: 20

Compression:

Stored size: 1.04 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 :each 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 :each do
    connection.close
  end


  it "is idempotent (succeeds)" do
    ch = connection.create_channel
    x  = ch.fanout("amq.fanout")
    q  = ch.queue("", :exclusive => true)

    # No exception as of RabbitMQ 3.2. MK.
    q.unbind(x)
    q.unbind(x)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bunny-1.7.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.7.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.3 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.2 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.5.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.0.rc2 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.0.rc1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.6.0.pre1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.5.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.5.0.pre2 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.5.0.pre1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.4.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.4.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.3.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.3.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.2.2 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.2.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-1.2.0 spec/higher_level_api/integration/queue_unbind_spec.rb