Sha256: 7f1fd22fb2d5d0005fe03b2f9c01c844044583503a6ad6dd66fc3907fdd8e8f8
Contents?: true
Size: 819 Bytes
Versions: 6
Compression:
Stored size: 819 Bytes
Contents
require 'spec_helper' describe Mongo::Socket::Unix do let(:socket) do described_class.new("/tmp/mongodb-#{SpecConfig.instance.any_port}.sock", 5) end describe '#connect!' do before do socket.connect! end after do socket.close end it 'connects to the server' do expect(socket).to be_alive end end describe '#alive?' do context 'when the socket is connected' do before do socket.connect! end after do socket.close end it 'returns true' do expect(socket).to be_alive end end context 'when the socket is not connected' do before do socket.close end it 'raises error' do expect { socket.alive? }.to raise_error(IOError) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems