From b4bdb2f2ebcdd8d77826706470fdeed642b3dee5 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 15 May 2012 20:13:21 +0000 Subject: * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string subclass dumping and loading. * test/psych/test_array.rb: pertinent tests * test/psych/test_string.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_string.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/psych/test_string.rb') diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb index c7d5c60623..77aefc6dae 100644 --- a/test/psych/test_string.rb +++ b/test/psych/test_string.rb @@ -9,6 +9,13 @@ module Psych attr_accessor :val end + def test_another_subclass_with_attributes + y = Psych.load Psych.dump Y.new("foo").tap {|y| y.val = 1} + assert_equal "foo", y + assert_equal Y, y.class + assert_equal 1, y.val + end + def test_backwards_with_syck x = Psych.load "--- !str:#{X.name} foo\n\n" assert_equal X, x.class -- cgit v1.2.3