Sha256: 3b64e010208cfa8de567e9060001b5665c8eb25860009250101236f3085c99e7

Contents?: true

Size: 439 Bytes

Versions: 36

Compression:

Stored size: 439 Bytes

Contents

module PrimarySocket
  def self.included(base)
    base.class_eval do

      let(:primary_server) do
        client.cluster.next_primary
      end

      let(:primary_connection) do
        connection = primary_server.pool.check_out
        connection.connect!
        primary_server.pool.check_in(connection)
        connection
      end

      let(:primary_socket) do
        primary_connection.send(:socket)
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
mongo-2.13.3 spec/support/primary_socket.rb
mongo-2.14.1 spec/support/primary_socket.rb
mongo-2.15.0.alpha spec/support/primary_socket.rb
mongo-2.13.2 spec/support/primary_socket.rb
mongo-2.14.0 spec/support/primary_socket.rb
mongo-2.14.0.rc1 spec/support/primary_socket.rb
mongo-2.13.1 spec/support/primary_socket.rb
mongo-2.12.4 spec/support/primary_socket.rb
mongo-2.11.6 spec/support/primary_socket.rb
mongo-2.13.0 spec/support/primary_socket.rb
mongo-2.12.3 spec/support/primary_socket.rb
mongo-2.13.0.rc1 spec/support/primary_socket.rb
mongo-2.12.2 spec/support/primary_socket.rb
mongo-2.10.5 spec/support/primary_socket.rb
mongo-2.11.5 spec/support/primary_socket.rb
mongo-2.13.0.beta1 spec/support/primary_socket.rb
mongo-2.12.1 spec/support/primary_socket.rb
mongo-2.12.0.rc0 spec/support/primary_socket.rb
mongo-2.11.4 spec/support/primary_socket.rb
mongo-2.10.4 spec/support/primary_socket.rb