From 813f8e333dabb2050d6b668b7bdd68b4979e8af4 Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Mon, 23 Oct 2017 15:17:31 +0530 Subject: Fix #to_json for unreadable IO objects, fixes #26132 --- activesupport/test/json/encoding_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/test/json') 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) -- cgit v1.2.3