Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* 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.
  • Loading branch information...
commit 1f4812fd517373cb827ba284a2e18112539046fb 1 parent bbd51b9
@tenderlove authored
View
7 CHANGELOG.rdoc
@@ -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>
* ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
View
1  lib/psych/visitors/yaml_tree.rb
@@ -47,6 +47,7 @@ def finish
def tree
finish unless finished?
+ @emitter.root
end
def push object
View
7 test/psych/visitors/test_yaml_tree.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.