Skip to content

Commit eba5bde

Browse files
committed
Use ENV replica set name in test suite
1 parent f1af9c4 commit eba5bde

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

spec/mongo/cluster_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
context 'when the option is not provided' do
8989

9090
let(:cluster) do
91-
described_class.new([ '127.0.0.1:27017' ], TEST_OPTIONS)
91+
described_class.new([ '127.0.0.1:27017' ], TEST_OPTIONS.dup.delete_if { |k| k == :replica_set })
9292
end
9393

9494
it 'returns nil' do

spec/support/authorization.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
# The topology type.
3737
#
3838
# @since 2.0.0
39-
CONNECT = ENV['RS_ENABLED'] == 'true' ? :replica_set.freeze :
40-
ENV['SHARDED_ENABLED'] == 'true' ? :sharded.freeze :
41-
:direct.freeze
39+
CONNECT = ENV['RS_ENABLED'] == 'true' ? { connect: :replica_set, replica_set: ENV['RS_NAME'] } :
40+
ENV['SHARDED_ENABLED'] == 'true' ? { connect: :sharded } :
41+
{ connect: :direct }
4242

4343
# The write concern to use in the tests.
4444
#
@@ -53,10 +53,10 @@
5353
# Options for test suite clients.
5454
#
5555
# @since 2.0.3
56-
TEST_OPTIONS = { connect: CONNECT,
57-
max_pool_size: 1,
58-
write: WRITE_CONCERN,
59-
ssl: SSL }
56+
TEST_OPTIONS = CONNECT.merge(max_pool_size: 1,
57+
write: WRITE_CONCERN,
58+
ssl: SSL,
59+
server_selection_timeout: 3)
6060

6161
# The root user name.
6262
#

0 commit comments

Comments
 (0)