summaryrefslogtreecommitdiff
path: root/test/psych/visitors/test_yaml_tree.rb
diff options
context:
space:
mode:
authorCharles Oliver Nutter <headius@headius.com>2015-01-09 10:06:51 -0600
committerCharles Oliver Nutter <headius@headius.com>2015-01-09 10:06:51 -0600
commit3ddffabc91bee3ba136a9367f24083b6bf9fd7ef (patch)
treee73ce4213df554530b1088bc9d082b62f46f2862 /test/psych/visitors/test_yaml_tree.rb
parentea50d0179c51d271c9fead299e9bf6dd06fe9689 (diff)
parent24055a152492123b7516e9b4e54af5710ffed247 (diff)
downloadpsych-3ddffabc91bee3ba136a9367f24083b6bf9fd7ef.tar.gz
Merge remote-tracking branch 'origin/master' into jruby
Conflicts: .gitignore
Diffstat (limited to 'test/psych/visitors/test_yaml_tree.rb')
-rw-r--r--test/psych/visitors/test_yaml_tree.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/test/psych/visitors/test_yaml_tree.rb b/test/psych/visitors/test_yaml_tree.rb
index df77563..40702bc 100644
--- a/test/psych/visitors/test_yaml_tree.rb
+++ b/test/psych/visitors/test_yaml_tree.rb
@@ -5,7 +5,25 @@ module Psych
class TestYAMLTree < TestCase
def setup
super
- @v = Visitors::YAMLTree.new
+ @v = Visitors::YAMLTree.create
+ end
+
+ def test_tree_can_be_called_twice
+ @v.start
+ @v << Object.new
+ t = @v.tree
+ assert_equal t, @v.tree
+ end
+
+ def test_yaml_tree_can_take_an_emitter
+ io = StringIO.new
+ e = Psych::Emitter.new io
+ v = Visitors::YAMLTree.create({}, e)
+ v.start
+ v << "hello world"
+ v.finish
+
+ assert_match "hello world", io.string
end
def test_binary_formatting