Sha256: 6a330414cc1fdc9d760fc341d2dbbe84c7da8c1796dee919d4b35f9bfe29e231

Contents?: true

Size: 960 Bytes

Versions: 37

Compression:

Stored size: 960 Bytes

Contents

# encoding: utf-8

require "spec_helper"

describe AMQP::Channel do
  describe ".next_channel_id" do
    before :all do
      described_class.reset_channel_id_allocator
    end

    context "when there is a channel id available for allocation" do
      it "returns that channel id" do
        1024.times { described_class.next_channel_id }

        described_class.next_channel_id.should == 1025
      end
    end

    context "when THERE IS NOT channel id available for allocation" do
      it "raises an exception"
    end
  end



  describe ".release_channel_id" do
    before :all do
      described_class.reset_channel_id_allocator
    end

    it "releases that channel id" do
      1024.times { described_class.next_channel_id }
      described_class.next_channel_id.should == 1025

      described_class.release_channel_id(128)
      described_class.next_channel_id.should == 128
      described_class.next_channel_id.should == 1026
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
amqp-1.0.0.pre1 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.5 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.4 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.3 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.2 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.1 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.0 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.0.pre3 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.0.pre2 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.9.0.pre1 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.4 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.3 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.2 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.1 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.0 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.0.rc15 spec/unit/amqp/channel_id_allocation_spec.rb
amqp-0.8.0.rc14 spec/unit/amqp/channel_id_allocation_spec.rb