Sha256: 8aeeb4c006ad80d0d0e42fe1a31e164bcacb70d1d527bb25b1357f5fe2ee35e3

Contents?: true

Size: 596 Bytes

Versions: 16

Compression:

Stored size: 596 Bytes

Contents

require 'spec_helper'

describe Mongo::Cluster::SocketReaper do

  let(:cluster) do
    authorized_client.cluster
  end

  let(:reaper) do
    described_class.new(cluster)
  end

  describe '#initialize' do

    it 'takes a cluster as an argument' do
      expect(reaper).to be_a(described_class)
    end
  end

  describe '#execute' do

    before do
      cluster.servers.each do |s|
        expect(s.pool).to receive(:close_stale_sockets!).and_call_original
      end
    end

    it 'calls close_stale_sockets on each connection pool in the cluster' do
      reaper.execute
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongo-2.8.0/spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.8.0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.7.2 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.8.0.rc0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.7.1 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.7.0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.7.0.rc0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.6.4 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.6.2 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.6.1 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.6.0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.5.3 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.5.2 spec/mongo/cluster/socket_reaper_spec.rb
tdiary-5.0.8 vendor/bundle/gems/mongo-2.5.1/spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.5.1 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.5.0 spec/mongo/cluster/socket_reaper_spec.rb