Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions core/tracepoint/raised_exception_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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