mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
[ruby/json] Fix JSON::GeneratorError#detailed_message with Ruby < 3.2
2e015ff839
This commit is contained in:
parent
f7af75d3d9
commit
e20f1f76f4
2 changed files with 13 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue