mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
[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.
f411ddf1ce
This commit is contained in:
parent
e8c46f4ca5
commit
ec171b4075
Notes:
git
2025-03-28 03:45:12 +00:00
4 changed files with 130 additions and 156 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue