From 0b392535df8ef68c969a2900e146d8b91f020706 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 5 Aug 2014 18:41:46 +0000 Subject: * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for hashes emitted by Syck. Github #198 * test/psych/test_hash.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_hash.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/psych/test_hash.rb') diff --git a/test/psych/test_hash.rb b/test/psych/test_hash.rb index dac7f8d7d8..264a4719e2 100644 --- a/test/psych/test_hash.rb +++ b/test/psych/test_hash.rb @@ -10,6 +10,11 @@ module Psych @hash = { :a => 'b' } end + def test_load_with_class_syck_compatibility + hash = Psych.load "--- !ruby/object:Hash\n:user_id: 7\n:username: Lucas\n" + assert_equal({ user_id: 7, username: 'Lucas'}, hash) + end + def test_empty_subclass assert_match "!ruby/hash:#{X}", Psych.dump(X.new) x = Psych.load Psych.dump X.new -- cgit v1.2.3