From f09e5a61346fc6e8ec73301d0b5cc9284f90ae57 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Wed, 15 Jan 2014 15:18:11 +0100 Subject: [PATCH] Test for bug: Subclasses of string loses encoding --- test/psych/test_string.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb index 01fc0e4b..31ff0b81 100644 --- a/test/psych/test_string.rb +++ b/test/psych/test_string.rb @@ -85,9 +85,11 @@ def test_empty_character_subclass end def test_subclass_with_attributes - y = Psych.load Psych.dump Y.new.tap {|y| y.val = 1} - assert_equal Y, y.class - assert_equal 1, y.val + y = Y.new.tap {|y| y.val = 1} + desarialized_y = Psych.load Psych.dump y + assert_equal Y, desarialized_y.class + assert_equal 1, desarialized_y.val + assert_equal desarialized_y.encoding, y.encoding end def test_string_with_base_60