summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-08-29 14:41:41 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-08-29 14:41:41 -0700
commit29d4544ff07dbb51421c7fab6e8bd54baecc78c0 (patch)
tree3e32f18dbe17ba8ae521d9800f1a3e0e2799ac06 /test/psych/test_exception.rb
parentad86a7474d61fcdce25e6aceec3e29bec3dd919f (diff)
downloadpsych-29d4544ff07dbb51421c7fab6e8bd54baecc78c0.zip
* ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping and
loading. Fixes GH #85. Thanks @brentdax for the patch! * test/psych/test_exception.rb: test for fix fixes #85
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r--test/psych/test_exception.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index a9fe5c4..30dfb24 100644
--- a/test/psych/test_exception.rb
+++ b/test/psych/test_exception.rb
@@ -16,6 +16,12 @@ module Psych
@wups = Wups.new
end
+ def test_naming_exception
+ err = String.xxx rescue $!
+ new_err = Psych.load(Psych.dump(err))
+ assert_equal err.message, new_err.message
+ end
+
def test_load_takes_file
ex = assert_raises(Psych::SyntaxError) do
Psych.load '--- `'