Sha256: 57056947e947be745b7731aae48ef53fd4f557d8c2cf7e46144733982c540a49

Contents?: true

Size: 924 Bytes

Versions: 18

Compression:

Stored size: 924 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

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

18 entries across 18 versions & 1 rubygems

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