File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 91
91
out . should == ""
92
92
$?. exitstatus . should == 21
93
93
end
94
+
95
+ it "overrides the original exception and exit status when called from #at_exit" do
96
+ code = <<-RUBY
97
+ at_exit do
98
+ STDERR.puts 'in at_exit'
99
+ STDERR.puts "$! is \# {$!.class}:\# {$!.message}"
100
+ #{ @object } .send(:exit!, 21)
101
+ end
102
+ raise 'original error'
103
+ RUBY
104
+ out = ruby_exe ( code , args : '2>&1' )
105
+ out . should == "in at_exit\n $! is RuntimeError:original error\n "
106
+ $?. exitstatus . should == 21
107
+ end
94
108
end
Original file line number Diff line number Diff line change @@ -4,3 +4,5 @@ slow:Kernel#exit! exits when called from a fiber
4
4
slow:Kernel.exit! exits with the given status
5
5
slow:Kernel.exit! exits when called from a thread
6
6
slow:Kernel.exit! exits when called from a fiber
7
+ slow:Kernel#exit! overrides the original exception and exit status when called from #at_exit
8
+ slow:Kernel.exit! overrides the original exception and exit status when called from #at_exit
Original file line number Diff line number Diff line change 1
1
slow:Process.exit! exits with the given status
2
2
slow:Process.exit! exits when called from a thread
3
3
slow:Process.exit! exits when called from a fiber
4
+ slow:Process.exit! overrides the original exception and exit status when called from #at_exit
You can’t perform that action at this time.
0 commit comments