Skip to content

Commit 8f90de7

Browse files
authored
Merge pull request #851 from ruby/fix-flaky-test
Backport `JSONCommonInterfaceTest#test_unsafe_load_default_options`
2 parents 56c0b62 + 7a8ec82 commit 8f90de7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/json/json_common_interface_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ def test_unsafe_load_default_options
226226
nan_json = '{ "foo": NaN }'
227227
assert JSON.unsafe_load(nan_json, nil)['foo'].nan?
228228
assert_equal nil, JSON.unsafe_load(nil, nil)
229-
t = Time.now
230-
assert_equal t, JSON.unsafe_load(JSON(t))
229+
t = Time.new(2025, 9, 3, 14, 50, 0)
230+
assert_equal t.to_s, JSON.unsafe_load(JSON(t)).to_s
231231
end
232232

233233
def test_unsafe_load_with_options

0 commit comments

Comments
 (0)