HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.7.4/spec/ruby/core/signal/signame_spec.rb
require_relative '../../spec_helper'

describe "Signal.signame" do
  it "takes a signal name with a well known signal number" do
    Signal.signame(0).should == "EXIT"
  end

  it "returns nil if the argument is an invalid signal number" do
    Signal.signame(-1).should == nil
  end

  it "raises a TypeError when the passed argument can't be coerced to Integer" do
    -> { Signal.signame("hello") }.should raise_error(TypeError)
  end

  platform_is_not :windows do
    it "the original should take precedence over alias when looked up by number" do
      Signal.signame(Signal.list["ABRT"]).should == "ABRT"
      Signal.signame(Signal.list["CHLD"]).should == "CHLD"
    end
  end
end