Sha256: 26454d325d752aae7b0eef26d8e879ef58a1d0ddb483ae27c0c178706d97f98c

Contents?: true

Size: 488 Bytes

Versions: 18

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

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

18 entries across 18 versions & 1 rubygems

Version Path
mongo-2.16.4 spec/support/primary_socket.rb
mongo-2.17.4 spec/support/primary_socket.rb
mongo-2.18.3 spec/support/primary_socket.rb
mongo-2.18.2 spec/support/primary_socket.rb
mongo-2.17.3 spec/support/primary_socket.rb
mongo-2.18.1 spec/support/primary_socket.rb
mongo-2.18.0 spec/support/primary_socket.rb
mongo-2.17.2 spec/support/primary_socket.rb
mongo-2.16.3 spec/support/primary_socket.rb
mongo-2.18.0.beta1 spec/support/primary_socket.rb
mongo-2.16.2 spec/support/primary_socket.rb
mongo-2.17.1 spec/support/primary_socket.rb
mongo-2.16.1 spec/support/primary_socket.rb
mongo-2.17.0 spec/support/primary_socket.rb
mongo-2.16.0 spec/support/primary_socket.rb
mongo-2.15.1 spec/support/primary_socket.rb
mongo-2.16.0.alpha1 spec/support/primary_socket.rb
mongo-2.15.0 spec/support/primary_socket.rb