summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-28 23:31:16 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-28 23:31:16 +0000
commit137c52d90918f7c66aff58e4fcf4d517d28e2213 (patch)
tree8967690aa3b895f7987b94b604337c1cc4f0f13b /test
parentb0db8f0bcd9373aebb2adfb07983b24e277989c6 (diff)
merges a part of r30931 from trunk into ruby_1_9_2.
-- * ext/psych/lib/psych/json/stream.rb: do not emit custom tags in maps or sequences when emitting JSON. * ext/psych/lib/psych/json/tree_builder.rb: do not emit custom tags in sequences when emitting JSON. * test/psych/json/test_stream.rb: tests for custom stream emits. * test/psych/test_json_tree.rb: tests for JSON emits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_json_tree.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/psych/test_json_tree.rb b/test/psych/test_json_tree.rb
index 96e17be961..590482c0bb 100644
--- a/test/psych/test_json_tree.rb
+++ b/test/psych/test_json_tree.rb
@@ -31,6 +31,17 @@ module Psych
assert_match(/['"]two['"]/, json)
end
+ class Bar
+ def encode_with coder
+ coder.represent_seq 'omg', %w{ a b c }
+ end
+ end
+
+ def test_json_list_dump_exclude_tag
+ json = Psych.to_json Bar.new
+ refute_match('omg', json)
+ end
+
def test_list_to_json
list = %w{ one two }
json = Psych.to_json(list)