File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1141,6 +1141,9 @@ def generate_audience_error(expected, actual)
11411141 end
11421142
11431143 it "optionally allows for clock drift on NotOnOrAfter" do
1144+ # Java Floats behave differently than MRI
1145+ java = %w[ jruby truffleruby ] . include? ( ENV [ 'RUBY_ENGINE' ] )
1146+
11441147 settings . soft = true
11451148
11461149 # The NotBefore condition in the document is 2011-06-1418:31:01.516Z
@@ -1154,7 +1157,7 @@ def generate_audience_error(expected, actual)
11541157
11551158 special_response_with_saml2_namespace = OneLogin ::RubySaml ::Response . new (
11561159 response_document_with_saml2_namespace ,
1157- :allowed_clock_drift => 0.484
1160+ :allowed_clock_drift => java ? 0.485 : 0.484
11581161 )
11591162 assert special_response_with_saml2_namespace . send ( :validate_conditions )
11601163
@@ -1167,7 +1170,7 @@ def generate_audience_error(expected, actual)
11671170
11681171 special_response_with_saml2_namespace = OneLogin ::RubySaml ::Response . new (
11691172 response_document_with_saml2_namespace ,
1170- :allowed_clock_drift => '0.484'
1173+ :allowed_clock_drift => java ? '0.485' : '0.484'
11711174 )
11721175 assert special_response_with_saml2_namespace . send ( :validate_conditions )
11731176 end
Original file line number Diff line number Diff line change @@ -185,6 +185,9 @@ class RubySamlTest < Minitest::Test
185185 end
186186
187187 it "optionally allows for clock drift" do
188+ # Java Floats behave differently than MRI
189+ java = %w[ jruby truffleruby ] . include? ( ENV [ 'RUBY_ENGINE' ] )
190+
188191 logout_request . soft = true
189192 logout_request . document . root . attributes [ 'NotOnOrAfter' ] = '2011-06-14T18:31:01.516Z'
190193
@@ -193,13 +196,13 @@ class RubySamlTest < Minitest::Test
193196 logout_request . options [ :allowed_clock_drift ] = 0.483
194197 assert !logout_request . send ( :validate_not_on_or_after )
195198
196- logout_request . options [ :allowed_clock_drift ] = 0.484
199+ logout_request . options [ :allowed_clock_drift ] = java ? 0.485 : 0.484
197200 assert logout_request . send ( :validate_not_on_or_after )
198201
199202 logout_request . options [ :allowed_clock_drift ] = '0.483'
200203 assert !logout_request . send ( :validate_not_on_or_after )
201204
202- logout_request . options [ :allowed_clock_drift ] = '0.484'
205+ logout_request . options [ :allowed_clock_drift ] = java ? '0.485' : '0.484'
203206 assert logout_request . send ( :validate_not_on_or_after )
204207 end
205208 end
You can’t perform that action at this time.
0 commit comments