* ext/psych/lib/psych/visitors/to_ruby.rb (resolve_klass): fix the

exception message when attempting to load an unknown class.  Thanks
  nobu! [ruby-dev:41399]

* test/psych/test_psych.rb: test for the exception message

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2010-06-18 18:38:19 +00:00
parent da3cdd2ddf
commit b09ad2b847
3 changed files with 19 additions and 4 deletions

View file

@ -246,13 +246,13 @@ module Psych
begin
path2class(name)
rescue ArgumentError => ex
name = "Struct::#{name}"
rescue ArgumentError, NameError => ex
unless retried
retried = true
name = "Struct::#{name}"
retried = ex
retry
end
raise ex
raise retried
end
end
end