2018-03-04 10:09:32 -05:00
|
|
|
require_relative '../../spec_helper'
|
2017-05-07 08:04:49 -04:00
|
|
|
|
|
|
|
describe "Process.setsid" do
|
2019-04-28 17:20:11 -04:00
|
|
|
platform_is_not :windows do
|
2017-05-07 08:04:49 -04:00
|
|
|
it "establishes this process as a new session and process group leader" do
|
2019-04-28 17:20:11 -04:00
|
|
|
sid = Process.getsid
|
2017-05-07 08:04:49 -04:00
|
|
|
|
2019-04-28 17:20:11 -04:00
|
|
|
out = ruby_exe("p Process.getsid; p Process.setsid; p Process.getsid").lines
|
|
|
|
out[0].should == "#{sid}\n"
|
|
|
|
out[1].should == out[2]
|
|
|
|
out[2].should_not == "#{sid}\n"
|
|
|
|
|
|
|
|
sid.should == Process.getsid
|
2017-05-07 08:04:49 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|