Sha256: abad18a62be3ee7601eb26299e5ce084f45194fbbbee8b6eccc1018c6cbb0a92

Contents?: true

Size: 840 Bytes

Versions: 18

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

shared_examples 'message with a header' do
  let(:collection_name) { 'test' }

  describe 'header' do
    describe 'length' do
      let(:field) { bytes.to_s[0..3] }
      it 'serializes the length' do
        expect(field).to be_int32(bytes.length)
      end
    end

    describe 'request id' do
      let(:field) { bytes.to_s[4..7] }
      it 'serializes the request id' do
        expect(field).to be_int32(message.request_id)
      end
    end

    describe 'response to' do
      let(:field) { bytes.to_s[8..11] }
      it 'serializes the response to' do
        expect(field).to be_int32(0)
      end
    end

    describe 'op code' do
      let(:field) { bytes.to_s[12..15] }
      it 'serializes the op code' do
        expect(field).to be_int32(opcode)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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