diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-18 18:38:19 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-18 18:38:19 +0000 |
commit | b09ad2b8476d3e42d35ef8bf17cbfa94d45150e1 (patch) | |
tree | bf9ef752e42a8d46834b9da81069402b7f17f2a7 /test | |
parent | da3cdd2ddf9cabc4f50ee7461c04a24333c4eb34 (diff) | |
download | ruby-b09ad2b8476d3e42d35ef8bf17cbfa94d45150e1.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/test_psych.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index 4f78ea96d9..0d33cb1970 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -14,6 +14,13 @@ class TestPsych < Psych::TestCase end end + def test_non_existing_class_on_deserialize + e = assert_raises(ArgumentError) do + Psych.load("--- !ruby/object:NonExistent\nfoo: 1") + end + assert_equal 'undefined class/module NonExistent', e.message + end + def test_dump_stream things = [22, "foo \n", {}] stream = Psych.dump_stream(*things) |