Sha256: 15b6a1c149ccb7ce1d8c5791ad1750ccbeac80420d8e35ea631f7383e1ba48b6

Contents?: true

Size: 1.04 KB

Versions: 22

Compression:

Stored size: 1.04 KB

Contents

require "spec_helper"

describe Bunny::Channel, "when opened" 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 "without explicitly provided id" do
    it "gets an allocated id and is successfully opened" do
      connection.should be_connected
      ch = connection.create_channel
      ch.should be_open

      ch.id.should be > 0
    end
  end


  context "with explicitly provided id" do
    it "uses that id and is successfully opened" do
      ch = connection.create_channel(767)
      connection.should be_connected
      ch.should be_open

      ch.id.should == 767
    end
  end



  context "with explicitly provided id that is already taken" do
    it "reuses the channel that is already opened" do
      ch = connection.create_channel(767)
      connection.should be_connected
      ch.should be_open

      ch.id.should == 767

      connection.create_channel(767).should == ch
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bunny-1.0.5 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.1.0.pre2 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.1.0.pre1 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.4 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.3 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.2 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.1 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0.rc3 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0.rc2 spec/higher_level_api/integration/channel_open_spec.rb
bunny-0.10.8 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0.rc1 spec/higher_level_api/integration/channel_open_spec.rb
bunny-0.10.7 spec/higher_level_api/integration/channel_open_spec.rb
bunny-0.10.6 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0.pre6 spec/higher_level_api/integration/channel_open_spec.rb
bunny-0.10.5 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0.pre5 spec/higher_level_api/integration/channel_open_spec.rb
bunny-0.10.4 spec/higher_level_api/integration/channel_open_spec.rb
bunny-0.10.3 spec/higher_level_api/integration/channel_open_spec.rb
bunny-1.0.0.pre4 spec/higher_level_api/integration/channel_open_spec.rb