Skip to content

Commit

Permalink
substring match test
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Nov 13, 2023
1 parent 662e950 commit beca7c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/lib/redacting_logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,13 @@

expect(log_output).to match(/\[REDACTED\]: This is a message/)
end

it "redacts the message when it is a substring of the redact pattern" do
logger.info("This is a supersecretmessage")

log_device.rewind
log_output = log_device.read
expect(log_output).to match(/This is a super\[REDACTED\]message/)
end
end
end

0 comments on commit beca7c3

Please sign in to comment.