diff options
author | Paul Kuruvilla <rohitpaulk@gmail.com> | 2017-10-23 15:17:31 +0530 |
---|---|---|
committer | Paul Kuruvilla <rohitpaulk@gmail.com> | 2017-10-23 15:49:00 +0530 |
commit | 813f8e333dabb2050d6b668b7bdd68b4979e8af4 (patch) | |
tree | 1bdf5e8b3e657f2cd8dd73b247724b51bb33d5fc /activesupport/test/json | |
parent | f4d1aa5310284ebceb51970140fa08f6c8ea19b6 (diff) | |
download | rails-813f8e333dabb2050d6b668b7bdd68b4979e8af4.tar.gz rails-813f8e333dabb2050d6b668b7bdd68b4979e8af4.tar.bz2 rails-813f8e333dabb2050d6b668b7bdd68b4979e8af4.zip |
Fix #to_json for unreadable IO objects, fixes #26132
Diffstat (limited to 'activesupport/test/json')
-rw-r--r-- | activesupport/test/json/encoding_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index eafa2e1712..96ad8dfbdb 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -454,6 +454,10 @@ EXPECTED assert_equal '{"number":null}', NaNNumber.new.to_json end + def test_to_json_works_on_io_objects + assert_equal STDOUT.to_s.to_json, STDOUT.to_json + end + private def object_keys(json_object) |