Skip to content

Commit

Permalink
* ext/psych/lib/psych/visitors/yaml_tree.rb: tree should return the
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
tenderlove committed Oct 28, 2012
1 parent dbe6250 commit f8d34b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Sun Oct 28 10:12:15 2012 Aaron Patterson <[email protected]>

* 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 <[email protected]>

* ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
Expand Down
1 change: 1 addition & 0 deletions ext/psych/lib/psych/visitors/yaml_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def finish

def tree
finish unless finished?
@emitter.root
end

def push object
Expand Down
7 changes: 7 additions & 0 deletions test/psych/visitors/test_yaml_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ def setup
@v = Visitors::YAMLTree.new
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
Expand Down

0 comments on commit f8d34b2

Please sign in to comment.