aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json/encoding_test.rb
diff options
context:
space:
mode:
authorSebi Burkhard <sebi.burkhard@gmail.com>2011-08-15 16:54:13 +0700
committerSebi Burkhard <sebi.burkhard@gmail.com>2011-08-15 16:54:13 +0700
commit7b53d1372df4bbc7a539b5e493ff1491ec460397 (patch)
treee0bbc310f37c6c6099cc07973b587ca208ddd89a /activesupport/test/json/encoding_test.rb
parent652ab436db674a112bcbc72d8c73e21f2ced512a (diff)
downloadrails-7b53d1372df4bbc7a539b5e493ff1491ec460397.tar.gz
rails-7b53d1372df4bbc7a539b5e493ff1491ec460397.tar.bz2
rails-7b53d1372df4bbc7a539b5e493ff1491ec460397.zip
JSON: Encode infinite or NaN floats as null to generate valid JSON.
Diffstat (limited to 'activesupport/test/json/encoding_test.rb')
-rw-r--r--activesupport/test/json/encoding_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index 8cf1a54a99..018207853f 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -27,6 +27,9 @@ class TestJSONEncoding < Test::Unit::TestCase
NilTests = [[ nil, %(null) ]]
NumericTests = [[ 1, %(1) ],
[ 2.5, %(2.5) ],
+ [ 0.0/0.0, %(null) ],
+ [ 1.0/0.0, %(null) ],
+ [ -1.0/0.0, %(null) ],
[ BigDecimal('2.5'), %("#{BigDecimal('2.5').to_s}") ]]
StringTests = [[ 'this is the <string>', %("this is the \\u003Cstring\\u003E")],