Skip to content

Commit 0c8efe1

Browse files
committed
Fix deprecation warnings on tests
1 parent 8b21a84 commit 0c8efe1

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

test/authrequest_test.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class AuthrequestTest < Minitest::Test
165165
it "uuid is initialized to nil" do
166166
request = RubySaml::Authrequest.new
167167

168-
assert_nil(request.uuid)
169-
assert_equal request.request_id, request.uuid
168+
assert_nil request.uuid
169+
assert_nil request.request_id
170170
end
171171

172172
it "creates request with ID prefixed with default '_'" do
@@ -200,7 +200,8 @@ class AuthrequestTest < Minitest::Test
200200
it "can mutate the uuid" do
201201
request = RubySaml::Authrequest.new
202202
request_id = request.request_id
203-
assert_equal request_id, request.uuid
203+
assert_nil request.uuid
204+
assert_nil request_id
204205
request.uuid = "new_uuid"
205206
assert_equal "new_uuid", request.uuid
206207
assert_equal request.uuid, request.request_id

test/logoutrequest_test.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ class RequestTest < Minitest::Test
9898
it "uuid is initialized to nil" do
9999
request = RubySaml::Logoutrequest.new
100100

101-
assert_nil(request.uuid)
102-
assert_equal request.request_id, request.uuid
101+
assert_nil request.uuid
102+
assert_nil request.request_id
103103
end
104104

105105
it "creates request with ID prefixed with default '_'" do
@@ -133,7 +133,8 @@ class RequestTest < Minitest::Test
133133
it "can mutate the uuid" do
134134
request = RubySaml::Logoutrequest.new
135135
request_id = request.request_id
136-
assert_equal request_id, request.uuid
136+
assert_nil request.uuid
137+
assert_nil request_id
137138
request.uuid = "new_uuid"
138139
assert_equal "new_uuid", request.uuid
139140
assert_equal request.uuid, request.request_id

test/slo_logoutresponse_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ class SloLogoutresponseTest < Minitest::Test
8686
it "uuid is initialized to nil" do
8787
response = RubySaml::SloLogoutresponse.new
8888

89-
assert_nil(response.uuid)
90-
assert_equal response.response_id, response.uuid
89+
assert_nil response.uuid
90+
assert_nil response.response_id
9191
end
9292

9393
it "creates response with ID prefixed with default '_'" do
@@ -120,8 +120,8 @@ class SloLogoutresponseTest < Minitest::Test
120120

121121
it "can mutate the uuid" do
122122
response = RubySaml::SloLogoutresponse.new
123-
response_id = response.response_id
124-
assert_equal response_id, response.uuid
123+
assert_nil response.uuid
124+
assert_nil response.response_id
125125
response.uuid = "new_uuid"
126126
assert_equal "new_uuid", response.uuid
127127
assert_equal response.uuid, response.response_id

test/utils_test.rb

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

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

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

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

0 commit comments

Comments
 (0)