-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.2
-
Component/s: Public API
-
None
-
Environment:ruby 2.1.5
Calling Mongo::Collection#insert_many with an array containing a document that exceed the size limit of mongodb document raises NoMethodError: undefined method `each_with_index'. I was expecting it to raise Mongo::Error::MaxBSONSize
In the spec below the second example fails.
require 'spec_helper' describe "Inserting Document exeeding max size" do let(:documents) do [{ '_id' => 1, 'name' => '1'*17000000 }] end context 'insert_many' do it 'raise MaxBSONSize' do expect { authorized_collection.insert_many(documents) }.to raise_error(Mongo::Error::MaxBSONSize) end end end