Skip to content

Commit 97a47e2

Browse files
committed
Improve tests format
1 parent b999eb9 commit 97a47e2

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

test/response_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,14 +1070,14 @@ class RubySamlTest < Minitest::Test
10701070
end
10711071

10721072
it "check what happens when trying retrieve attribute that does not exists" do
1073-
assert_equal nil, response_multiple_attr_values.attributes[:attribute_not_exists]
1074-
assert_equal nil, response_multiple_attr_values.attributes.single(:attribute_not_exists)
1075-
assert_equal nil, response_multiple_attr_values.attributes.multi(:attribute_not_exists)
1073+
assert_nil response_multiple_attr_values.attributes[:attribute_not_exists]
1074+
assert_nil response_multiple_attr_values.attributes.single(:attribute_not_exists)
1075+
assert_nil response_multiple_attr_values.attributes.multi(:attribute_not_exists)
10761076

10771077
OneLogin::RubySaml::Attributes.single_value_compatibility = false
1078-
assert_equal nil, response_multiple_attr_values.attributes[:attribute_not_exists]
1079-
assert_equal nil, response_multiple_attr_values.attributes.single(:attribute_not_exists)
1080-
assert_equal nil, response_multiple_attr_values.attributes.multi(:attribute_not_exists)
1078+
assert_nil response_multiple_attr_values.attributes[:attribute_not_exists]
1079+
assert_nil response_multiple_attr_values.attributes.single(:attribute_not_exists)
1080+
assert_nil response_multiple_attr_values.attributes.multi(:attribute_not_exists)
10811081
OneLogin::RubySaml::Attributes.single_value_compatibility = true
10821082
end
10831083

test/settings_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ class SettingsTest < Minitest::Test
9999
it "returns nil when the cert is an empty string" do
100100
@settings = OneLogin::RubySaml::Settings.new
101101
@settings.idp_cert = ""
102-
assert_equal nil, @settings.get_idp_cert
102+
assert_nil @settings.get_idp_cert
103103
end
104104

105105
it "returns nil when the cert is nil" do
106106
@settings = OneLogin::RubySaml::Settings.new
107107
@settings.idp_cert = nil
108-
assert_equal nil, @settings.get_idp_cert
108+
assert_nil @settings.get_idp_cert
109109
end
110110

111111
it "returns the certificate when it is valid" do
@@ -127,13 +127,13 @@ class SettingsTest < Minitest::Test
127127
it "returns nil when the cert is an empty string" do
128128
@settings = OneLogin::RubySaml::Settings.new
129129
@settings.certificate = ""
130-
assert_equal nil, @settings.get_sp_cert
130+
assert_nil @settings.get_sp_cert
131131
end
132132

133133
it "returns nil when the cert is nil" do
134134
@settings = OneLogin::RubySaml::Settings.new
135135
@settings.certificate = nil
136-
assert_equal nil, @settings.get_sp_cert
136+
assert_nil @settings.get_sp_cert
137137
end
138138

139139
it "returns the certificate when it is valid" do
@@ -156,13 +156,13 @@ class SettingsTest < Minitest::Test
156156
it "returns nil when the private key is an empty string" do
157157
@settings = OneLogin::RubySaml::Settings.new
158158
@settings.private_key = ""
159-
assert_equal nil, @settings.get_sp_key
159+
assert_nil @settings.get_sp_key
160160
end
161161

162162
it "returns nil when the private key is nil" do
163163
@settings = OneLogin::RubySaml::Settings.new
164164
@settings.private_key = nil
165-
assert_equal nil, @settings.get_sp_key
165+
assert_nil @settings.get_sp_key
166166
end
167167

168168
it "returns the private key when it is valid" do

test/slo_logoutrequest_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class RubySamlTest < Minitest::Test
106106
describe "#not_on_or_after" do
107107
it "extract the value of the NotOnOrAfter attribute" do
108108
time_value = '2014-07-17T01:01:48Z'
109-
assert_equal nil, logout_request.not_on_or_after
109+
assert_nil logout_request.not_on_or_after
110110
logout_request.document.root.attributes['NotOnOrAfter'] = time_value
111111
assert_equal Time.parse(time_value), logout_request.not_on_or_after
112112
end

test/utils_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class UtilsTest < Minitest::Test
1313

1414
it "returns nil when the cert is nil" do
1515
cert = nil
16-
assert_equal nil, OneLogin::RubySaml::Utils.format_cert(cert)
16+
assert_nil OneLogin::RubySaml::Utils.format_cert(cert)
1717
end
1818

1919
it "returns the certificate when it is valid" do
@@ -48,7 +48,7 @@ class UtilsTest < Minitest::Test
4848

4949
it "returns nil when the private key is nil" do
5050
private_key = nil
51-
assert_equal nil, OneLogin::RubySaml::Utils.format_private_key(private_key)
51+
assert_nil OneLogin::RubySaml::Utils.format_private_key(private_key)
5252
end
5353

5454
it "returns the private key when it is valid" do

0 commit comments

Comments
 (0)