summaryrefslogtreecommitdiff
path: root/test/psych/json/test_stream.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/json/test_stream.rb')
-rw-r--r--test/psych/json/test_stream.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/psych/json/test_stream.rb b/test/psych/json/test_stream.rb
index 252535abaa..45d0219aad 100644
--- a/test/psych/json/test_stream.rb
+++ b/test/psych/json/test_stream.rb
@@ -71,6 +71,26 @@ module Psych
assert_match(/["]two["]/, json)
end
+ class Foo; end
+
+ def test_json_dump_exclude_tag
+ @stream << Foo.new
+ json = @io.string
+ refute_match('Foo', 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
+ @stream << Bar.new
+ json = @io.string
+ refute_match('omg', json)
+ end
+
def test_time
time = Time.utc(2010, 10, 10)
@stream.push({'a' => time })