test/-ext-/exception/test_exception_at_throwing.rb
raw| 1 | # frozen_string_literal: true |
| 2 | require 'test/unit' |
| 3 | |
| 4 | module Bug |
| 5 | class Test_ExceptionAT < Test::Unit::TestCase |
| 6 | def test_exception_at_throwing |
| 7 | assert_separately(%w[-r-test-/exception], "#{<<-"begin;"}\n#{<<-"end;"}") |
| 8 | begin; |
| 9 | e = RuntimeError.new("[Bug #13176]") |
| 10 | assert_raise_with_message(e.class, e.message) do |
| 11 | catch do |t| |
| 12 | Bug::Exception.ensure_raise(nil, e) {throw t} |
| 13 | end |
| 14 | end |
| 15 | end; |
| 16 | end |
| 17 | end |
| 18 | end |