Sha256: 7c1a4c0b42873cfc47c8148c6cb26170e0eb3e4af385bc0af3fae82e5207a4dd

Contents?: true

Size: 747 Bytes

Versions: 36

Compression:

Stored size: 747 Bytes

Contents

require 'spec_helper'

describe Mongo::Address::Unix do

  let(:resolver) do
    described_class.new(*described_class.parse(address))
  end

  describe 'self.parse' do

    it 'returns the host and no port' do
      expect(described_class.parse('/path/to/socket.sock')).to eq(['/path/to/socket.sock'])
    end
  end

  describe '#initialize' do

    let(:address) do
      '/path/to/socket.sock'
    end

    it 'sets the host' do
      expect(resolver.host).to eq('/path/to/socket.sock')
    end
  end

  describe '#socket' do

    let(:address) do
      '/tmp/mongodb-27017.sock'
    end

    let(:socket) do
      resolver.socket(5)
    end

    it 'returns a unix socket' do
      expect(socket).to be_a(Mongo::Socket::Unix)
    end
  end
end

Version data entries

36 entries across 33 versions & 3 rubygems

Version Path
mongo-2.6.1 spec/mongo/address/unix_spec.rb
mongo-2.6.0 spec/mongo/address/unix_spec.rb
mongo-2.5.3 spec/mongo/address/unix_spec.rb
mongo-2.5.2 spec/mongo/address/unix_spec.rb
tdiary-5.0.8 vendor/bundle/gems/mongo-2.5.1/spec/mongo/address/unix_spec.rb
mongo-2.5.1 spec/mongo/address/unix_spec.rb
mongo-2.5.0 spec/mongo/address/unix_spec.rb
mongo-2.5.0.beta spec/mongo/address/unix_spec.rb
mongo-2.4.3 spec/mongo/address/unix_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongo-2.4.1/spec/mongo/address/unix_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongo-2.4.2/spec/mongo/address/unix_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongo-2.4.1/spec/mongo/address/unix_spec.rb
mongo-2.4.2 spec/mongo/address/unix_spec.rb
tdiary-5.0.4 vendor/bundle/gems/mongo-2.4.1/spec/mongo/address/unix_spec.rb
mongo-2.4.1 spec/mongo/address/unix_spec.rb
mongo-2.4.0 spec/mongo/address/unix_spec.rb
mongo-2.3.1 spec/mongo/address/unix_spec.rb
mongo-2.4.0.rc1 spec/mongo/address/unix_spec.rb
mongo-2.4.0.rc0 spec/mongo/address/unix_spec.rb
mongo-2.3.0 spec/mongo/address/unix_spec.rb