Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
2.1.2
-
None
-
ruby 2.1.5
Description
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
|