summaryrefslogtreecommitdiff
path: root/tests/json_generator_test.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-10-20 21:33:52 +0900
committerGitHub <noreply@github.com>2020-10-20 21:33:52 +0900
commit01e4823ee1b9837d7289ae4eb35c9d74535e0f5e (patch)
treefba7e360e7768522e7569a7c07bee4c72e6bfc50 /tests/json_generator_test.rb
parent07c34048ff758c81be9d8b30f5d63084e5e9e072 (diff)
parentb8c1c640cd375f2e2ccca1b18bf943f80ad04816 (diff)
downloadjson-01e4823ee1b9837d7289ae4eb35c9d74535e0f5e.tar.gz
Merge pull request #449 from chrisseaton/pretty-empty
Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations
Diffstat (limited to 'tests/json_generator_test.rb')
-rwxr-xr-xtests/json_generator_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb
index 77b539d..2ecdc97 100755
--- a/tests/json_generator_test.rb
+++ b/tests/json_generator_test.rb
@@ -92,6 +92,11 @@ EOT
end
def test_generate_pretty
+ json = pretty_generate({})
+ assert_equal(<<'EOT'.chomp, json)
+{
+}
+EOT
json = pretty_generate(@hash)
# hashes aren't (insertion) ordered on every ruby implementation
# assert_equal(@json3, json)