Sha256: 4d0fc6dcbe417b0f41c232f1802f04d55a71491a1e005ce0818e2e5ece676604

Contents?: true

Size: 877 Bytes

Versions: 19

Compression:

Stored size: 877 Bytes

Contents

require "spec_helper"

describe Bunny::Channel 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

  let(:n) { 200 }

  context "when publishing with confirms enabled" do
    it "increments delivery index" do
      ch = connection.create_channel
      ch.should_not be_using_publisher_confirmations

      ch.confirm_select
      ch.should be_using_publisher_confirmations

      q  = ch.queue("", :exclusive => true)
      x  = ch.default_exchange

      n.times do
        x.publish("xyzzy", :routing_key => q.name)
      end

      ch.next_publish_seq_no.should == n + 1
      ch.wait_for_confirms.should be_true
      sleep 0.25

      q.message_count.should == n
      q.purge

      ch.close
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bunny-0.10.8 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.7 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.6 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.5 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.4 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.3 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.2 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.1 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.10.0 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.pre3 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.8 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.pre2 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.7 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.6 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.5 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.4 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.pre1 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.3 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.2 spec/higher_level_api/integration/publisher_confirms_spec.rb