File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 211
211
[ '127.0.0.1:27017' ] ,
212
212
:read => { :mode => :primary } ,
213
213
:database => TEST_DB ,
214
- :password => '123 ' ,
214
+ :password => 'some_password ' ,
215
215
:user => 'emily'
216
216
)
217
217
end
218
218
219
219
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 ' )
221
221
end
222
222
end
223
223
end
Original file line number Diff line number Diff line change 11
11
context 'when the hash contains a sensitive key' do
12
12
13
13
let ( :original_opts ) do
14
- { password : '123 ' }
14
+ { password : 'sensitive_data ' }
15
15
end
16
16
17
17
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 ] )
19
19
end
20
20
21
21
it 'replaces the value with the redacted string' do
36
36
context 'when the hash contains a sensitive key' do
37
37
38
38
let ( :original_opts ) do
39
- { password : '123 ' }
39
+ { password : 'sensitive_data ' }
40
40
end
41
41
42
42
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 ] )
44
44
end
45
45
46
46
it 'replaces the value with the redacted string' do
51
51
context 'when the hash does not contain a sensitive key' do
52
52
53
53
let ( :original_opts ) do
54
- { name : '123 ' }
54
+ { name : 'some_name ' }
55
55
end
56
56
57
57
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 ] )
59
59
end
60
60
61
61
it 'does not replace the value with the redacted string' do
You can’t perform that action at this time.
0 commit comments