Skip to content

Commit

Permalink
Implement a test for logger to work with secrets having regex special…
Browse files Browse the repository at this point in the history
… chars
  • Loading branch information
alessandro-fazzi committed Dec 12, 2019
1 parent 7f9196b commit 96e2b41
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/logger/logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 96e2b41

Please sign in to comment.