2018-08-03 16:19:40 +00:00
|
|
|
require_relative '../spec_helper'
|
|
|
|
require_relative '../fixtures/classes'
|
2018-03-04 15:09:32 +00:00
|
|
|
require_relative 'shared/new'
|
2017-05-07 12:04:49 +00:00
|
|
|
|
|
|
|
describe "UNIXServer.open" do
|
|
|
|
it_behaves_like :unixserver_new, :open
|
|
|
|
|
|
|
|
platform_is_not :windows do
|
|
|
|
before :each do
|
2017-05-14 14:09:56 +00:00
|
|
|
@path = SocketSpecs.socket_path
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
after :each do
|
|
|
|
@server.close if @server
|
|
|
|
@server = nil
|
2017-05-14 14:09:56 +00:00
|
|
|
SocketSpecs.rm_socket @path
|
2017-05-07 12:04:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "yields the new UNIXServer object to the block, if given" do
|
|
|
|
UNIXServer.open(@path) do |unix|
|
|
|
|
unix.path.should == @path
|
|
|
|
unix.addr.should == ["AF_UNIX", @path]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|