mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@fd6eddd
This commit is contained in:
parent
44736a6b7a
commit
95d9fe9538
26 changed files with 501 additions and 84 deletions
|
@ -29,7 +29,23 @@ describe "rescuing Interrupt" do
|
|||
sleep
|
||||
rescue Interrupt => e
|
||||
e.signo.should == Signal.list["INT"]
|
||||
e.signm.should == ""
|
||||
["", "Interrupt"].should.include?(e.message)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "Interrupt" do
|
||||
# This spec is basically the same as above,
|
||||
# but it does not rely on Signal.trap(:INT, :SIG_DFL) which can be tricky
|
||||
it "is raised on the main Thread by the default SIGINT handler" do
|
||||
out = ruby_exe(<<-'RUBY', args: "2>&1")
|
||||
begin
|
||||
Process.kill :INT, Process.pid
|
||||
sleep
|
||||
rescue Interrupt => e
|
||||
puts "Interrupt: #{e.signo}"
|
||||
end
|
||||
RUBY
|
||||
out.should == "Interrupt: #{Signal.list["INT"]}\n"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue