Skip to content

Commit 127e6e7

Browse files
committed
Spec that Signal.trap(sig, :IGNORE) ignores the signal
1 parent 87d4bd5 commit 127e6e7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

spec/ruby/core/signal/trap_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
ScratchPad.recorded.should be_true
4848
end
4949

50+
it "registers an handler doing nothing with :IGNORE" do
51+
Signal.trap :HUP, :IGNORE
52+
Process.kill(:HUP, Process.pid).should == 1
53+
end
54+
5055
it "ignores the signal when passed nil" do
5156
Signal.trap :HUP, nil
5257
Signal.trap(:HUP, @saved_trap).should be_nil

spec/tags/core/signal/trap_tags.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ slow:Signal.trap the special EXIT signal code can unset the handler
66
slow:Signal.trap returns 'DEFAULT' for the initial SIGINT handler
77
slow:Signal.trap accepts 'SYSTEM_DEFAULT' and uses the OS handler for SIGPIPE
88
slow:Signal.trap allows to register a handler for all known signals, except reserved signals for which it raises ArgumentError
9+
fails:Signal.trap registers an handler doing nothing with :IGNORE

0 commit comments

Comments
 (0)