|
49 | 49 | end |
50 | 50 | end |
51 | 51 |
|
52 | | - # TODO: get this test passing |
53 | | - # context 'with client options' do |
54 | | - # let(:client_opts) do |
55 | | - # { |
56 | | - # auth_mech: auth_mech_sym, |
57 | | - # user: user, |
58 | | - # password: pwd, |
59 | | - # } |
60 | | - # end |
61 | | - |
62 | | - # it 'creates a client with default auth source' do |
63 | | - # expect(client.options['auth_source']).to eq(default_auth_source) |
64 | | - # end |
65 | | - # end |
| 52 | + context 'with client options' do |
| 53 | + let(:client_opts) do |
| 54 | + { |
| 55 | + auth_mech: auth_mech_sym, |
| 56 | + user: user, |
| 57 | + password: pwd, |
| 58 | + } |
| 59 | + end |
| 60 | + |
| 61 | + it 'creates a client with default auth source' do |
| 62 | + expect(client.options['auth_source']).to eq(default_auth_source) |
| 63 | + end |
| 64 | + end |
66 | 65 | end |
67 | 66 |
|
68 | 67 | context 'where database is provided' do |
|
77 | 76 | end |
78 | 77 | end |
79 | 78 |
|
80 | | - # TODO: get this test passing |
81 | | - # context 'with client options' do |
82 | | - # let(:client_opts) do |
83 | | - # { |
84 | | - # auth_mech: auth_mech_sym, |
85 | | - # user: user, |
86 | | - # password: pwd, |
87 | | - # database: database |
88 | | - # } |
89 | | - # end |
90 | | - |
91 | | - # it 'creates a client with database as auth source' do |
92 | | - # expect(client.options['auth_source']).to eq(database) |
93 | | - # end |
94 | | - # end |
| 79 | + context 'with client options' do |
| 80 | + let(:client_opts) do |
| 81 | + { |
| 82 | + auth_mech: auth_mech_sym, |
| 83 | + user: user, |
| 84 | + password: pwd, |
| 85 | + database: database |
| 86 | + } |
| 87 | + end |
| 88 | + |
| 89 | + it 'creates a client with database as auth source' do |
| 90 | + expect(client.options['auth_source']).to eq(database) |
| 91 | + end |
| 92 | + end |
95 | 93 | end |
96 | 94 | end |
97 | 95 |
|
|
117 | 115 | auth_mech: auth_mech_sym, |
118 | 116 | ssl: true, |
119 | 117 | ssl_cert: cert_path, |
| 118 | + ssl_key: cert_path, |
120 | 119 | ssl_ca_cert: ca_file_path, |
121 | 120 | user: user, |
122 | 121 | password: pwd |
|
127 | 126 | expect(client.options[:ssl]).to be true |
128 | 127 | expect(client.options[:ssl_cert]).to eq(cert_path) |
129 | 128 | expect(client.options[:ssl_ca_cert]).to eq(ca_file_path) |
130 | | - # TODO: get this expectation passing |
131 | | - # expect(client.options[:ssl_key]).to eq(cert_path) |
| 129 | + expect(client.options[:ssl_key]).to eq(cert_path) |
132 | 130 | end |
133 | 131 | end |
134 | 132 | end |
|
245 | 243 | end |
246 | 244 | end |
247 | 245 |
|
248 | | - # TODO: get this test passing |
249 | | - # context 'with client options' do |
250 | | - # let(:client_opts) do |
251 | | - # { |
252 | | - # auth_mech: :gssapi, |
253 | | - # user: user, |
254 | | - # password: pwd |
255 | | - # } |
256 | | - # end |
257 | | - |
258 | | - # it 'sets default auth mech properties' do |
259 | | - # expect(client.options[:auth_mech_properties]).to eq({ 'service_name' => 'mongodb' }) |
260 | | - # end |
261 | | - # end |
| 246 | + context 'with client options' do |
| 247 | + let(:client_opts) do |
| 248 | + { |
| 249 | + auth_mech: :gssapi, |
| 250 | + user: user, |
| 251 | + password: pwd |
| 252 | + } |
| 253 | + end |
| 254 | + |
| 255 | + it 'sets default auth mech properties' do |
| 256 | + expect(client.options[:auth_mech_properties]).to eq({ 'service_name' => 'mongodb' }) |
| 257 | + end |
| 258 | + end |
262 | 259 | end |
263 | 260 |
|
264 | 261 | context 'with PLAIN auth mechanism' do |
|
312 | 309 | context 'with client options' do |
313 | 310 | let(:client_opts) { { auth_mech: :mongodb_x509, user: user } } |
314 | 311 |
|
315 | | - # TODO: get this test passing |
316 | | - # it 'sets default auth source' do |
317 | | - # expect(client.options[:auth_source]).to eq('$external') |
318 | | - # end |
| 312 | + it 'sets default auth source' do |
| 313 | + expect(client.options[:auth_source]).to eq('$external') |
| 314 | + end |
319 | 315 |
|
320 | 316 | context 'when username is not provided' do |
321 | 317 | let(:client_opts) { { auth_mech: :mongodb_x509} } |
|
0 commit comments