Sha256: 1c9573366a9e27dc3ecd6b7be2cc5ef4ab92a6cb27e63caf9f9ba37264137a2f

Contents?: true

Size: 593 Bytes

Versions: 21

Compression:

Stored size: 593 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_idle_sockets).and_call_original
      end
    end

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
mongo-2.11.6 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.5 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.5 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.4 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.4 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.3 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.2 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.1 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.3 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.9.2 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.2 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.11.0.rc0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.1 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.9.1 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.10.0.rc0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.9.1.rc0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.9.0 spec/mongo/cluster/socket_reaper_spec.rb
mongo-2.9.0.rc1 spec/mongo/cluster/socket_reaper_spec.rb