Skip to content

Commit f46d606

Browse files
committed
RUBY-1051 Check that an Operation Result is created with top-level Result class defined
1 parent 0a65823 commit f46d606

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

spec/mongo/operation/result_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,23 @@
272272
end
273273
end
274274
end
275+
276+
context 'when there is a top-level Result class defined' do
277+
278+
before do
279+
class Result
280+
def get_result
281+
Mongo::Client.new([DEFAULT_ADDRESS]).database.command(:ping => 1)
282+
end
283+
end
284+
end
285+
286+
let(:result) do
287+
Result.new.get_result
288+
end
289+
290+
it 'uses the Result class of the operation' do
291+
expect(result).to be_a(Mongo::Operation::Result)
292+
end
293+
end
275294
end

0 commit comments

Comments
 (0)