Skip to content

Commit

Permalink
fix ambiguous regex warnings (#720)
Browse files Browse the repository at this point in the history
This test warns

    warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator

We can fix this warning by using the %r regex syntax instead
  • Loading branch information
HParker authored Sep 30, 2024
1 parent 1bc447f commit ef997f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,11 @@ def result(duration, reference = 0)
end

it 'successfully decrypts with the first private key' do
assert_match /\A<saml:Assertion/, OneLogin::RubySaml::Utils.decrypt_multi(encrypted, [private_key])
assert_match %r{\A<saml:Assertion}, OneLogin::RubySaml::Utils.decrypt_multi(encrypted, [private_key])
end

it 'successfully decrypts with a subsequent private key' do
assert_match /\A<saml:Assertion/, OneLogin::RubySaml::Utils.decrypt_multi(encrypted, [invalid_key1, private_key])
assert_match %r{\A<saml:Assertion}, OneLogin::RubySaml::Utils.decrypt_multi(encrypted, [invalid_key1, private_key])
end

it 'raises an error when there is only one key and it fails to decrypt' do
Expand Down

0 comments on commit ef997f0

Please sign in to comment.