diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-15 20:13:21 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-15 20:13:21 +0000 |
commit | b4bdb2f2ebcdd8d77826706470fdeed642b3dee5 (patch) | |
tree | 38ef0e7b78fb18f913b9d2cfbd2061cf924cb86c /test/psych/test_array.rb | |
parent | 5341e3ccc4a58ae765e6d78c65bdc33157527aec (diff) | |
download | ruby-b4bdb2f2ebcdd8d77826706470fdeed642b3dee5.tar.gz |
* 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
Diffstat (limited to 'test/psych/test_array.rb')
-rw-r--r-- | test/psych/test_array.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/psych/test_array.rb b/test/psych/test_array.rb index 9eedbb4fda..747fe95062 100644 --- a/test/psych/test_array.rb +++ b/test/psych/test_array.rb @@ -14,6 +14,16 @@ module Psych @list = [{ :a => 'b' }, 'foo'] end + def test_another_subclass_with_attributes + y = Y.new.tap {|y| y.val = 1} + y << "foo" << "bar" + y = Psych.load Psych.dump y + + assert_equal %w{foo bar}, y + assert_equal Y, y.class + assert_equal 1, y.val + end + def test_subclass yaml = Psych.dump X.new assert_match X.name, yaml |