Skip to content

Commit

Permalink
add non-ascii test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Sep 10, 2024
1 parent f25e6f1 commit 9fd2cc3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions spec/datadog/di/redactor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@ def self.define_cases(cases)

define_cases(cases)

context "when user-defined redacted identifiers exist" do
context 'when user-defined redacted identifiers exist' do
before do
expect(di_settings).to receive(:redacted_identifiers).and_return(%w[foo quux])
expect(di_settings).to receive(:redacted_identifiers).and_return(%w(foo пароль Ключ))
end

cases = [
["exact user-defined identifier", "foo", true],
["prefix of user-defined identifier", "f", false],
["suffix of user-defined identifier", "oo", false],
["user-defined identifier with extra punctuation", "f-o-o", true],
['exact user-defined identifier', 'foo', true],
['prefix of user-defined identifier', 'f', false],
['suffix of user-defined identifier', 'oo', false],
['user-defined identifier with extra punctuation', 'f-o-o', true],
['user-defined identifier is not ascii', 'ПАРОЛь', true],
['user-defined identifier is not ascii and uses mixed case in definition', 'ключ', true],
['user-defined identifier is not ascii and uses mixed case in definition and is not exact match', 'ключ1', false],
]

define_cases(cases)
Expand Down

0 comments on commit 9fd2cc3

Please sign in to comment.