File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,8 @@ def files_collection
157157 end
158158
159159 def with_write_concern ( collection )
160- if collection . write_concern . options == write_concern . options
160+ if write_concern . nil? || collection . write_concern . nil? ||
161+ collection . write_concern . options == write_concern . options
161162 collection
162163 else
163164 collection . client . with ( write : write_concern . options ) [ collection . name ]
Original file line number Diff line number Diff line change 6666 end
6767 end
6868
69+ context 'when the fs does not have a write concern' do
70+
71+ let ( :fs ) do
72+ authorized_client . with ( write : nil ) . database . fs
73+ end
74+
75+ it 'uses the write concern default at the operation level' do
76+ expect ( stream . write ( file ) . closed? ) . to eq ( false )
77+ end
78+ end
79+
6980 context 'when provided options' do
7081
7182 context 'when provided a write option' do
You can’t perform that action at this time.
0 commit comments