diff options
author | Florian Frank <flori@ping.de> | 2011-10-02 14:48:55 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2011-10-02 14:48:55 +0200 |
commit | 5dcfa3711a14a6a027ce6b2b62d9117fb78da1b7 (patch) | |
tree | fdef1e294758edde001d6449645f444e19f7f76c /tests | |
parent | e6ada3ffde2384ff47f9e7e673a73b415846dc1f (diff) | |
download | json-5dcfa3711a14a6a027ce6b2b62d9117fb78da1b7.tar.gz |
Add support for BigDecimal numbers
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_json_addition.rb | 6 |
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 |