Sha256: 25ffdba3d4bfeb4c18abc6fc10d3b0745980f305d99f94a0b447810c0a7f496e

Contents?: true

Size: 1.03 KB

Versions: 30

Compression:

Stored size: 1.03 KB

Contents

require "spec_helper"

describe Bunny::Queue, "bound to an exchange" do
  let(:connection) do
    c = Bunny.new(username: "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
    expect(q.message_count).to eq 1

    q.unbind(x)

    x.publish("")
    expect(q.message_count).to eq 1
  end
end



describe Bunny::Queue, "NOT bound to an exchange" do
  let(:connection) do
    c = Bunny.new(username: "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

30 entries across 30 versions & 1 rubygems

Version Path
bunny-2.19.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.18.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.17.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.16.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.15.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.14.4 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.14.3 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.14.2 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.14.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.13.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.12.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.12.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.12.0.rc1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.11.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.11.0.pre1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.10.0 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.9.2 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.9.1 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.6.7 spec/higher_level_api/integration/queue_unbind_spec.rb
bunny-2.7.4 spec/higher_level_api/integration/queue_unbind_spec.rb