aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/socket/unixserver/shared/new.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket/unixserver/shared/new.rb')
-rw-r--r--spec/ruby/library/socket/unixserver/shared/new.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/ruby/library/socket/unixserver/shared/new.rb b/spec/ruby/library/socket/unixserver/shared/new.rb
new file mode 100644
index 0000000000..2018140caa
--- /dev/null
+++ b/spec/ruby/library/socket/unixserver/shared/new.rb
@@ -0,0 +1,23 @@
+require File.expand_path('../../../../../spec_helper', __FILE__)
+require File.expand_path('../../../fixtures/classes', __FILE__)
+require 'tempfile'
+
+describe :unixserver_new, shared: true do
+ platform_is_not :windows do
+ before :each do
+ @path = SocketSpecs.socket_path
+ end
+
+ after :each do
+ @server.close if @server
+ @server = nil
+ SocketSpecs.rm_socket @path
+ end
+
+ it "creates a new UNIXServer" do
+ @server = UNIXServer.send(@method, @path)
+ @server.path.should == @path
+ @server.addr.should == ["AF_UNIX", @path]
+ end
+ end
+end