summaryrefslogtreecommitdiff
path: root/tests/test_json_addition.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_json_addition.rb')
-rwxr-xr-xtests/test_json_addition.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_json_addition.rb b/tests/test_json_addition.rb
index b9cc6d1..1b85e02 100755
--- a/tests/test_json_addition.rb
+++ b/tests/test_json_addition.rb
@@ -7,6 +7,7 @@ require 'json/add/core'
require 'json/add/complex'
require 'json/add/rational'
require 'json/add/bigdecimal'
+require 'json/add/ostruct'
require 'date'
class TC_JSONAddition < Test::Unit::TestCase
@@ -177,4 +178,11 @@ class TC_JSONAddition < Test::Unit::TestCase
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
+
+ def test_ostruct
+ o = OpenStruct.new
+ # XXX this won't work; o.foo = { :bar => true }
+ o.foo = { 'bar' => true }
+ assert_equal o, JSON(JSON(o))
+ end
end