Sha256: bc379591c7e508e04457b9522b6ebabc3c8c07d31555ac2202d91b59f151d7fc
Contents?: true
Size: 867 Bytes
Versions: 18
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true # encoding: utf-8 require 'spec_helper' describe 'Snappy compression' do require_snappy_compression before do authorized_client['test'].drop end context 'when client has snappy compressor option enabled' do it 'compresses the message to the server' do # Double check that the client has snappy compression enabled expect(authorized_client.options[:compressors]).to include('snappy') expect(Mongo::Protocol::Compressed).to receive(:new).twice.and_call_original expect(Snappy).to receive(:deflate).twice.and_call_original expect(Snappy).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
18 entries across 18 versions & 1 rubygems