Skip to content

Commit 5fb3a57

Browse files
committed
2220
1 parent 0516095 commit 5fb3a57

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

spec/integration/crud_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,31 +104,35 @@
104104
end
105105

106106
context 'with oplog_replay option' do
107+
let(:oplog_query) do
108+
{ts: {'$gt' => 1}}
109+
end
110+
107111
context 'passed to operation' do
108112
it 'passes the option' do
109113
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
111115
end
112116
event.command.fetch('oplogReplay').should be true
113117
end
114118

115119
it 'warns' do
116120
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
118122
end
119123
end
120124

121125
context 'set on collection' do
122126
it 'passes the option' do
123127
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
125129
end
126130
event.command.fetch('oplogReplay').should be true
127131
end
128132

129133
it 'warns' do
130134
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
132136
end
133137
end
134138
end

0 commit comments

Comments
 (0)