summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@github.com>2019-01-09 13:53:48 -0800
committerGitHub <noreply@github.com>2019-01-09 13:53:48 -0800
commit63c94cf4f1a877a84c9bbed2ccabc773f9e56035 (patch)
tree36540abdd3e1e6286f6da14b4674e91c939d93f3 /test
parent8eb0be0d8dfc8d25facb0db078d9c90d753c6c82 (diff)
parente07a9d845410db939c22d357fdcebca5a7b00006 (diff)
downloadpsych-63c94cf4f1a877a84c9bbed2ccabc773f9e56035.zip
Merge pull request #382 from ruby/exception-handling-refactor
Exception backtraces should round trip
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_exception.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index df7fd73..e7fc88c 100644
--- a/test/psych/test_exception.rb
+++ b/test/psych/test_exception.rb
@@ -23,6 +23,20 @@ module Psych
$VERBOSE = @orig_verbose
end
+ def make_ex msg = 'oh no!'
+ begin
+ raise msg
+ rescue ::Exception => e
+ e
+ end
+ end
+
+ def test_backtrace
+ err = make_ex
+ new_err = Psych.load(Psych.dump(err))
+ assert_equal err.backtrace, new_err.backtrace
+ end
+
def test_naming_exception
err = String.xxx rescue $!
new_err = Psych.load(Psych.dump(err))