mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@07164da
This commit is contained in:
parent
7429841ab6
commit
126fd5f15c
38 changed files with 733 additions and 44 deletions
|
|
@ -91,4 +91,24 @@ describe :process_exit!, shared: true do
|
|||
out.should == ""
|
||||
$?.exitstatus.should == 21
|
||||
end
|
||||
|
||||
it "skips at_exit handlers" do
|
||||
out = ruby_exe("at_exit { STDERR.puts 'at_exit' }; #{@object}.send(:exit!, 21)", args: '2>&1')
|
||||
out.should == ""
|
||||
$?.exitstatus.should == 21
|
||||
end
|
||||
|
||||
it "overrides the original exception and exit status when called from #at_exit" do
|
||||
code = <<-RUBY
|
||||
at_exit do
|
||||
STDERR.puts 'in at_exit'
|
||||
STDERR.puts "$! is \#{$!.class}:\#{$!.message}"
|
||||
#{@object}.send(:exit!, 21)
|
||||
end
|
||||
raise 'original error'
|
||||
RUBY
|
||||
out = ruby_exe(code, args: '2>&1')
|
||||
out.should == "in at_exit\n$! is RuntimeError:original error\n"
|
||||
$?.exitstatus.should == 21
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue