diff options
author | Jean Boussier <[email protected]> | 2025-03-27 12:25:08 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-03-28 12:44:53 +0900 |
commit | ec171b4075407d02698a445e169f57fd68a9dcfc (patch) | |
tree | 699ff6c756f7d364cc7896798ba5a1ff04076125 /test/json | |
parent | e8c46f4ca5e6ba2638fbfc81fdb9d141cd88e99a (diff) |
[ruby/json] Move `create_addtions` logic in Ruby.
By leveraging the `on_load` callback we can move all this logic
out of the parser. Which mean we no longer have to duplicate
that logic in both parser and that we'll later be able to extract
it entirely from the gem.
https://github.com/ruby/json/commit/f411ddf1ce
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13004
Diffstat (limited to 'test/json')
-rw-r--r-- | test/json/json_addition_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/json/json_addition_test.rb b/test/json/json_addition_test.rb index 4d8d186873..a98e06df8c 100644 --- a/test/json/json_addition_test.rb +++ b/test/json/json_addition_test.rb @@ -151,7 +151,12 @@ class JSONAdditionTest < Test::Unit::TestCase end def test_deprecated_load_create_additions - assert_deprecated_warning(/use JSON\.unsafe_load/) do + pattern = /json_addition_test\.rb.*use JSON\.unsafe_load/ + if RUBY_ENGINE == 'truffleruby' + pattern = /use JSON\.unsafe_load/ + end + + assert_deprecated_warning(pattern) do JSON.load(JSON.dump(Time.now)) end end |