Sha256: 6b33eae419775b08f1a0c2b742b4f5d526918ed758c35fa4c495d75ecd12887a
Contents?: true
Size: 817 Bytes
Versions: 12
Compression:
Stored size: 817 Bytes
Contents
require 'spec_helper' describe 'Zlib compression' do require_compression before do authorized_client['test'].drop end context 'when client has zlib compressor option enabled' do it 'compresses the message to the server' do # Double check that the client has zlib compression enabled expect(authorized_client.options[:compressors]).to include('zlib') expect(Mongo::Protocol::Compressed).to receive(:new).twice.and_call_original expect(Zlib::Deflate).to receive(:deflate).twice.and_call_original expect(Zlib::Inflate).to receive(:inflate).twice.and_call_original authorized_client['test'].insert_one(_id: 1, text: 'hello world') document = authorized_client['test'].find(_id: 1).first expect(document['text']).to eq('hello world') end end end
Version data entries
12 entries across 12 versions & 1 rubygems