diff --git a/core/tracepoint/raised_exception_spec.rb b/core/tracepoint/raised_exception_spec.rb index ca2f50abb..5ac853184 100644 --- a/core/tracepoint/raised_exception_spec.rb +++ b/core/tracepoint/raised_exception_spec.rb @@ -17,4 +17,22 @@ raised_exception.should equal(error_result) end end + + ruby_version_is "3.3" do + it 'returns value from exception rescued on the :rescue event' do + raised_exception, error_result = nil + trace = TracePoint.new(:rescue) { |tp| + next unless TracePointSpec.target_thread? + raised_exception = tp.raised_exception + } + trace.enable do + begin + raise StandardError + rescue => e + error_result = e + end + raised_exception.should equal(error_result) + end + end + end end