Sha256: 940c08efd4a7f4f4818d354ace7e99efa920655481d27caad2bf73bea8086d26

Contents?: true

Size: 875 Bytes

Versions: 18

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'spec_helper'

describe 'Error detection' do
  context 'document contains a not master/node recovering code' do
    let(:document) { {code: 91} }

    let(:coll) { authorized_client_without_any_retries['error-detection'] }

    before do
      coll.delete_many
    end

    context 'cursors not used' do

      before do
        coll.insert_one(document)
      end

      it 'is not treated as an error when retrieved' do
        actual = coll.find.first
        expect(actual['code']).to eq(91)
      end
    end

    context 'cursors used' do

      before do
        10.times do
          coll.insert_one(document)
        end
      end

      it 'is not treated as an error when retrieved' do
        actual = coll.find({}, batch_size: 2).first
        expect(actual['code']).to eq(91)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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