File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 104
104
end
105
105
106
106
context 'with oplog_replay option' do
107
+ let ( :oplog_query ) do
108
+ { ts : { '$gt' => 1 } }
109
+ end
110
+
107
111
context 'passed to operation' do
108
112
it 'passes the option' do
109
113
event = Utils . get_command_event ( client , 'find' ) do |client |
110
- client [ 'foo' ] . find ( { ts : { '$gt' => 1 } } , oplog_replay : true ) . to_a
114
+ client [ 'foo' ] . find ( oplog_query , oplog_replay : true ) . to_a
111
115
end
112
116
event . command . fetch ( 'oplogReplay' ) . should be true
113
117
end
114
118
115
119
it 'warns' do
116
120
client . should receive ( :log_warn ) . with ( 'The :oplog_replay option is deprecated and ignored by MongoDB 4.4 and later' )
117
- client [ 'foo' ] . find ( { ts : { '$gt' => 1 } } , oplog_replay : true ) . to_a
121
+ client [ 'foo' ] . find ( oplog_query , oplog_replay : true ) . to_a
118
122
end
119
123
end
120
124
121
125
context 'set on collection' do
122
126
it 'passes the option' do
123
127
event = Utils . get_command_event ( client , 'find' ) do |client |
124
- client [ 'foo' , oplog_replay : true ] . find . to_a
128
+ client [ 'foo' , oplog_replay : true ] . find ( oplog_query ) . to_a
125
129
end
126
130
event . command . fetch ( 'oplogReplay' ) . should be true
127
131
end
128
132
129
133
it 'warns' do
130
134
client . should receive ( :log_warn ) . with ( 'The :oplog_replay option is deprecated and ignored by MongoDB 4.4 and later' )
131
- client [ 'foo' , oplog_replay : true ] . find . to_a
135
+ client [ 'foo' , oplog_replay : true ] . find ( oplog_query ) . to_a
132
136
end
133
137
end
134
138
end
You can’t perform that action at this time.
0 commit comments