Sha256: 9a5c71161f2a98b11ad489e606be1d71196b01b817334fd50f72c008f5676413

Contents?: true

Size: 909 Bytes

Versions: 13

Compression:

Stored size: 909 Bytes

Contents

require "spec_helper"

describe Bunny::Channel do
  let(:connection) do
    c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :continuation_timeout => 10000)
    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

13 entries across 13 versions & 1 rubygems

Version Path
bunny-1.1.0.pre2 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.1.0.pre1 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.4 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.3 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.2 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.1 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.rc3 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.rc2 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.rc1 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.pre6 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.pre5 spec/higher_level_api/integration/publisher_confirms_spec.rb
bunny-1.0.0.pre4 spec/higher_level_api/integration/publisher_confirms_spec.rb