diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_exception.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 37b5f7068c..1179c26c51 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -799,6 +799,13 @@ end.join assert_nil(orig_error.cause, bug13043) end + def test_cause_with_frozen_exception + exc = ArgumentError.new("foo").freeze + assert_raise_with_message(ArgumentError, exc.message) { + raise exc, cause: RuntimeError.new("bar") + } + end + def test_anonymous_message assert_in_out_err([], "raise Class.new(RuntimeError), 'foo'", [], /foo\n/) end |