Sha256: a6b1e2c8842c87e00e757698bdd525645e1ec4b7a07cb2f0fef606b24b0a3e29

Contents?: true

Size: 925 Bytes

Versions: 9

Compression:

Stored size: 925 Bytes

Contents

# frozen_string_literal: true
# rubocop:todo all

require 'spec_helper'

describe Mongo::Collection::View::Iterable do
  let(:selector) do
    {}
  end

  let(:options) do
    {}
  end

  let(:view) do
    Mongo::Collection::View.new(authorized_collection, selector, options)
  end

  before do
    authorized_collection.drop
  end

  describe '#each' do
    context 'when allow_disk_use is provided' do
      let(:options) { { allow_disk_use: true } }

      # Other cases are adequately covered by spec tests.
      context 'on server versions < 3.2' do
        max_server_fcv '3.0'

        it 'raises an exception' do
          expect do
            view.each do |document|
              #Do nothing
            end
          end.to raise_error(Mongo::Error::UnsupportedOption, /The MongoDB server handling this request does not support the allow_disk_use option on this command/)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
mongo-2.21.0 spec/mongo/collection/view/iterable_spec.rb
mongo-2.20.1 spec/mongo/collection/view/iterable_spec.rb
mogno-2.20.0 spec/mongo/collection/view/iterable_spec.rb
mogno-1.0.0 spec/mongo/collection/view/iterable_spec.rb
mongo-2.20.0 spec/mongo/collection/view/iterable_spec.rb
mongo-2.19.3 spec/mongo/collection/view/iterable_spec.rb
mongo-2.19.2 spec/mongo/collection/view/iterable_spec.rb
mongo-2.19.1 spec/mongo/collection/view/iterable_spec.rb
mongo-2.19.0 spec/mongo/collection/view/iterable_spec.rb