summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2011-10-02 14:48:55 +0200
committerFlorian Frank <flori@ping.de>2011-10-02 14:48:55 +0200
commit5dcfa3711a14a6a027ce6b2b62d9117fb78da1b7 (patch)
treefdef1e294758edde001d6449645f444e19f7f76c /tests
parente6ada3ffde2384ff47f9e7e673a73b415846dc1f (diff)
downloadjson-5dcfa3711a14a6a027ce6b2b62d9117fb78da1b7.tar.gz
Add support for BigDecimal numbers
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_json_addition.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_json_addition.rb b/tests/test_json_addition.rb
index 9f578a4..b9cc6d1 100755
--- a/tests/test_json_addition.rb
+++ b/tests/test_json_addition.rb
@@ -6,6 +6,7 @@ require File.join(File.dirname(__FILE__), 'setup_variant')
require 'json/add/core'
require 'json/add/complex'
require 'json/add/rational'
+require 'json/add/bigdecimal'
require 'date'
class TC_JSONAddition < Test::Unit::TestCase
@@ -171,4 +172,9 @@ class TC_JSONAddition < Test::Unit::TestCase
assert_equal Rational(2, 9), JSON(JSON(Rational(2, 9)))
assert_equal Complex(2, 9), JSON(JSON(Complex(2, 9)))
end
+
+ def test_bigdecimal
+ assert_equal BigDecimal('3.141', 23), JSON(JSON(BigDecimal('3.141', 23)))
+ assert_equal BigDecimal('3.141', 666), JSON(JSON(BigDecimal('3.141', 666)))
+ end
end