Sha256: 4cc4e4791659074a0ee32cf22098502a45331a4f9314e59f225275ad1981781f

Contents?: true

Size: 845 Bytes

Versions: 8

Compression:

Stored size: 845 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 :all do
    connection.close if connection.open?
  end


  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

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

      ch.next_publish_seq_no.should == 501
      ch.wait_for_confirms
      sleep 0.25

      q.message_count.should == 500
      q.purge

      ch.close
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bunny-0.9.0.pre11 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre10 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre9 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre8 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre7 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre6 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre5 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-0.9.0.pre4 spec/higher_level_api/integration/publisher_confirms_spec.rb