mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@aaf998f
This commit is contained in:
parent
ae650f0372
commit
8db4f25bf4
41 changed files with 821 additions and 56 deletions
|
@ -66,6 +66,26 @@ describe :thread_exit, shared: true do
|
|||
ScratchPad.recorded.should == nil
|
||||
end
|
||||
|
||||
it "does not reset $!" do
|
||||
ScratchPad.record []
|
||||
|
||||
exc = RuntimeError.new("foo")
|
||||
thread = Thread.new do
|
||||
begin
|
||||
raise exc
|
||||
ensure
|
||||
ScratchPad << $!
|
||||
begin
|
||||
Thread.current.send(@method)
|
||||
ensure
|
||||
ScratchPad << $!
|
||||
end
|
||||
end
|
||||
end
|
||||
thread.join
|
||||
ScratchPad.recorded.should == [exc, exc]
|
||||
end
|
||||
|
||||
it "cannot be rescued" do
|
||||
thread = Thread.new do
|
||||
begin
|
||||
|
@ -73,7 +93,7 @@ describe :thread_exit, shared: true do
|
|||
rescue Exception
|
||||
ScratchPad.record :in_rescue
|
||||
end
|
||||
ScratchPad.record :end_of_thread_block
|
||||
ScratchPad.record :end_of_thread_block
|
||||
end
|
||||
|
||||
thread.join
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue