summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-09 03:51:39 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-09 03:51:39 +0000
commit4df71924e47bc0da8bbc3a08f814c48350131585 (patch)
tree26250b1a2ab441f51e7e8811dbf7416f84b4f929 /test
parent095b27946454cec5237e1ce229623e98905a937e (diff)
* ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when
people implement the method method. Thanks Lin Jen-Shin. [ruby-core:35255] * test/psych/visitors/test_yaml_tree.rb: test for implementation of method method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/psych/visitors/test_yaml_tree.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/psych/visitors/test_yaml_tree.rb b/test/psych/visitors/test_yaml_tree.rb
index ed89e78600..1cf0d634c8 100644
--- a/test/psych/visitors/test_yaml_tree.rb
+++ b/test/psych/visitors/test_yaml_tree.rb
@@ -38,6 +38,12 @@ module Psych
assert_equal s.foo, obj.foo
end
+ def test_override_method
+ s = Struct.new(:method).new('override')
+ obj = Psych.load(Psych.dump(s))
+ assert_equal s.method, obj.method
+ end
+
def test_exception
ex = Exception.new 'foo'
loaded = Psych.load(Psych.dump(ex))