Skip to content

Commit 2748bf5

Browse files
committed
RUBY-1021 use more unique string for password in tests
1 parent ca239e5 commit 2748bf5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

spec/mongo/client_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@
211211
['127.0.0.1:27017'],
212212
:read => { :mode => :primary },
213213
:database => TEST_DB,
214-
:password => '123',
214+
:password => 'some_password',
215215
:user => 'emily'
216216
)
217217
end
218218

219219
it 'does not print out sensitive data' do
220-
expect(client.inspect).not_to match('123')
220+
expect(client.inspect).not_to match('some_password')
221221
end
222222
end
223223
end

spec/mongo/options/redacted_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
context 'when the hash contains a sensitive key' do
1212

1313
let(:original_opts) do
14-
{ password: '123' }
14+
{ password: 'sensitive_data' }
1515
end
1616

1717
it 'replaces the value with the redacted string' do
18-
expect(options.to_s).not_to match(/123/)
18+
expect(options.to_s).not_to match(original_opts[:password])
1919
end
2020

2121
it 'replaces the value with the redacted string' do
@@ -36,11 +36,11 @@
3636
context 'when the hash contains a sensitive key' do
3737

3838
let(:original_opts) do
39-
{ password: '123' }
39+
{ password: 'sensitive_data' }
4040
end
4141

4242
it 'replaces the value with the redacted string' do
43-
expect(options.inspect).not_to match(/123/)
43+
expect(options.inspect).not_to match(original_opts[:password])
4444
end
4545

4646
it 'replaces the value with the redacted string' do
@@ -51,11 +51,11 @@
5151
context 'when the hash does not contain a sensitive key' do
5252

5353
let(:original_opts) do
54-
{ name: '123' }
54+
{ name: 'some_name' }
5555
end
5656

5757
it 'does not replace the value with the redacted string' do
58-
expect(options.inspect).to match(/123/)
58+
expect(options.inspect).to match(original_opts[:name])
5959
end
6060

6161
it 'does not replace the value with the redacted string' do

0 commit comments

Comments
 (0)