Sha256: 59324f00635e97e5cfba8be4e335f6d234b89ee14d0b3c8a92a2bdb8b424a9f8

Contents?: true

Size: 951 Bytes

Versions: 26

Compression:

Stored size: 951 Bytes

Contents

require "spec_helper"

unless defined?(JRUBY_VERSION) && !ENV["FORCE_JRUBY_RUN"]
  describe Bunny::Session do
    # creating thousands of connections means creating
    # twice as many threads and this won't fly with the JVM
    # in CI containers. MK.
    n = if defined?(JRUBY_VERSION)
          250
        else
          2500
        end

    n.times do |i|
      it "can be closed (take #{i})" do
        c  = Bunny.new(:automatically_recover => false)
        c.start
        ch = c.create_channel

        c.should be_connected
        c.stop
        c.should be_closed
      end
    end

    context "in the single threaded mode" do
      n.times do |i|
        it "can be closed (take #{i})" do
          c  = Bunny.new(:automatically_recover => false, :threaded => false)
          c.start
          ch = c.create_channel

          c.should be_connected
          c.stop
          c.should be_closed
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
bunny-1.0.2 spec/stress/connection_open_close_spec.rb
bunny-1.0.1 spec/stress/connection_open_close_spec.rb
bunny-1.0.0 spec/stress/connection_open_close_spec.rb
bunny-1.0.0.rc3 spec/stress/connection_open_close_spec.rb
bunny-1.0.0.rc2 spec/stress/connection_open_close_spec.rb
bunny-0.10.8 spec/stress/connection_open_close_spec.rb