mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/psych/lib/psych/visitors/yaml_tree.rb: tree
should return the
same thing on every call. * test/psych/visitors/test_yaml_tree.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dbe6250af2
commit
f8d34b2a75
3 changed files with 15 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Sun Oct 28 10:12:15 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
|
* ext/psych/lib/psych/visitors/yaml_tree.rb: `tree` should return the
|
||||||
|
same thing on every call.
|
||||||
|
|
||||||
|
* test/psych/visitors/test_yaml_tree.rb: related test.
|
||||||
|
|
||||||
Sun Oct 28 10:05:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
Sun Oct 28 10:05:03 2012 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
|
* ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
|
||||||
|
|
|
@ -47,6 +47,7 @@ module Psych
|
||||||
|
|
||||||
def tree
|
def tree
|
||||||
finish unless finished?
|
finish unless finished?
|
||||||
|
@emitter.root
|
||||||
end
|
end
|
||||||
|
|
||||||
def push object
|
def push object
|
||||||
|
|
|
@ -8,6 +8,13 @@ module Psych
|
||||||
@v = Visitors::YAMLTree.new
|
@v = Visitors::YAMLTree.new
|
||||||
end
|
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
|
def test_yaml_tree_can_take_an_emitter
|
||||||
io = StringIO.new
|
io = StringIO.new
|
||||||
e = Psych::Emitter.new io
|
e = Psych::Emitter.new io
|
||||||
|
|
Loading…
Reference in a new issue