Sha256: e68ddacd006f5c8d9124721472b782a327d15a1a842209d9ffd1533682035687

Contents?: true

Size: 675 Bytes

Versions: 55

Compression:

Stored size: 675 Bytes

Contents

require "spec_helper"

describe Bunny::Channel, "#prefetch" 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

  context "with a positive integer" do
    it "sets that prefetch level via basic.qos" do
      ch = connection.create_channel
      ch.prefetch(10).should be_instance_of(AMQ::Protocol::Basic::QosOk)
    end
  end

  context "with a negative integer" do
    it "raises an ArgumentError" do
      ch = connection.create_channel
      expect {
        ch.prefetch(-2)
      }.to raise_error(ArgumentError)
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
bunny-1.1.9 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.8 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.7 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.6 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.5 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.4 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.3 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.2 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.1 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.0 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.0.rc1 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.7 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.6 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.5 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.0.pre2 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.1.0.pre1 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.4 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.3 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.2 spec/higher_level_api/integration/basic_qos_spec.rb
bunny-1.0.1 spec/higher_level_api/integration/basic_qos_spec.rb