diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-27 18:40:33 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-09-27 18:40:33 -0700 |
commit | 6f404ba338038732d8f3ebbb02b977d1ab42e0a1 (patch) | |
tree | b09b439bb9d3bbb219288dd94ae9d170d025aff2 /test | |
parent | 7d3bb196d32afb5f9fe7ec54eb7f7f1c6fb41a86 (diff) | |
download | psych-6f404ba338038732d8f3ebbb02b977d1ab42e0a1.zip |
addign document and stream nodes
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/test_tree_builder.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/psych/test_tree_builder.rb b/test/psych/test_tree_builder.rb new file mode 100644 index 0000000..62998db --- /dev/null +++ b/test/psych/test_tree_builder.rb @@ -0,0 +1,28 @@ +require 'helper' + +module Psych + class TestTreeBuilder < Test::Unit::TestCase + def setup + @parser = Psych::Parser.new TreeBuilder.new + @parser.parse(<<-eoyml) +%YAML 1.1 +--- +- foo +- { + bar : &A !!str baz, + boo : *A +} + eoyml + @tree = @parser.handler.root + end + + def test_stream + assert_instance_of Nodes::Stream, @tree + end + + def test_documents + assert_equal 1, @tree.children.length + assert_instance_of Nodes::Document, @tree.children.first + end + end +end |