spec/mongo/operation/write/command/update_spec.rb in mongo-2.1.2 vs spec/mongo/operation/write/command/update_spec.rb in mongo-2.2.0.rc0

- old
+ new

@@ -60,9 +60,34 @@ end end end end + describe 'write concern' do + + context 'when write concern is not specified' do + + let(:spec) do + { :updates => updates, + :db_name => db_name, + :coll_name => coll_name, + :ordered => true + } + end + + it 'does not include write concern in the selector' do + expect(op.send(:selector)[:writeConcern]).to be_nil + end + end + + context 'when write concern is specified' do + + it 'includes write concern in the selector' do + expect(op.send(:selector)[:writeConcern]).to eq(write_concern.options) + end + end + end + describe '#execute' do context 'server' do context 'message' do