diff --git a/spec/logger/logger_spec.rb b/spec/logger/logger_spec.rb index fdfcb87..f5e4b0b 100644 --- a/spec/logger/logger_spec.rb +++ b/spec/logger/logger_spec.rb @@ -9,5 +9,15 @@ .to_stdout_from_any_process end end + + context "having a string with regexp special characters" do + let(:logger) { described_class.new(STDOUT, ['comp/3xPa((w0r]']) } + + it "will hide the passed strings" do + expect { logger.info('What I write is comp/3xPa((w0r]') } + .to output(/What I write is \[secret\]/) + .to_stdout_from_any_process + end + end end end