Skip to content

Commit ef997f0

Browse files
authored
fix ambiguous regex warnings (#720)
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
1 parent 1bc447f commit ef997f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/utils_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ def result(duration, reference = 0)
360360
end
361361

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

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

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

0 commit comments

Comments
 (0)