Sha256: df9e8989134fb8f4b030fc9ac4da6ccbe8fbd37ca666037d50f7ba40c0906d25

Contents?: true

Size: 769 Bytes

Versions: 13

Compression:

Stored size: 769 Bytes

Contents

require 'spec_helper'

describe Bunny::Session do
  context 'when retry attempts have been exhausted' do
    let(:io) { StringIO.new } # keep test output clear

    def create_session
      described_class.new(
        host: 'fake.host',
        recovery_attempts: 0,
        connection_timeout: 0,
        network_recovery_interval: 0,
        logfile: io,
      )
    end

    it 'closes the session' do
      session = create_session
      session.handle_network_failure(StandardError.new)
      expect(session.closed?).to be true
    end

    it 'stops the reader loop' do
      session = create_session
      reader_loop = session.reader_loop
      session.handle_network_failure(StandardError.new)
      expect(reader_loop.stopping?).to be true
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bunny-2.19.0 spec/issues/issue549_spec.rb
bunny-2.18.0 spec/issues/issue549_spec.rb
bunny-2.17.0 spec/issues/issue549_spec.rb
bunny-2.16.1 spec/issues/issue549_spec.rb
bunny-2.15.0 spec/issues/issue549_spec.rb
bunny-2.14.4 spec/issues/issue549_spec.rb
bunny-2.14.3 spec/issues/issue549_spec.rb
bunny-2.14.2 spec/issues/issue549_spec.rb
bunny-2.14.1 spec/issues/issue549_spec.rb
bunny-2.13.0 spec/issues/issue549_spec.rb
bunny-2.12.1 spec/issues/issue549_spec.rb
bunny-2.12.0 spec/issues/issue549_spec.rb
bunny-2.12.0.rc1 spec/issues/issue549_spec.rb