1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Retry until the signal is trapped.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-10-18 11:19:33 +00:00
parent 7db062cdc0
commit a07cef02a9

View file

@ -17,7 +17,10 @@ class TestSignal < Test::Unit::TestCase
x = 0
oldtrap = Signal.trap(:INT) {|sig| x = 2 }
Process.kill :INT, Process.pid
sleep 0.1
10.times do
break if 2 == x
sleep 0.1
end
assert_equal 2, x
Signal.trap(:INT) { raise "Interrupt" }