summaryrefslogtreecommitdiff
path: root/test/psych/test_array.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_array.rb')
-rw-r--r--test/psych/test_array.rb10
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