summaryrefslogtreecommitdiff
path: root/test/json/json_generator_test.rb
diff options
context:
space:
mode:
authorRahim Packir Saibo <[email protected]>2025-03-05 18:03:03 +0000
committerHiroshi SHIBATA <[email protected]>2025-03-06 18:29:27 +0900
commite20f1f76f4d7479faa112b612ba6f712a46c49fc (patch)
tree220f6d4009c1fbbcfc19df429ba6761c37e0b51e /test/json/json_generator_test.rb
parentf7af75d3d9239dadd66382e421f63790ad46aeb7 (diff)
[ruby/json] Fix JSON::GeneratorError#detailed_message with Ruby < 3.2
https://github.com/ruby/json/commit/2e015ff839
Diffstat (limited to 'test/json/json_generator_test.rb')
-rwxr-xr-xtest/json/json_generator_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb
index c67cd3349c..4a92801fe1 100755
--- a/test/json/json_generator_test.rb
+++ b/test/json/json_generator_test.rb
@@ -410,6 +410,14 @@ class JSONGeneratorTest < Test::Unit::TestCase
end
end
+ def test_json_generate_error_detailed_message
+ error = assert_raise JSON::GeneratorError do
+ generate(["\xea"])
+ end
+
+ assert_not_nil(error.detailed_message)
+ end
+
def test_json_generate_unsupported_types
assert_raise JSON::GeneratorError do
generate(Object.new, strict: true)