From e07a9d845410db939c22d357fdcebca5a7b00006 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 9 Jan 2019 13:34:51 -0800 Subject: Round trip exception backtraces This commit allows exception backtraces to round trip --- test/psych/test_exception.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') 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)) -- cgit v1.2.3