summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/unixserver/for_fd_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket/unixserver/for_fd_spec.rb')
-rw-r--r--spec/ruby/library/socket/unixserver/for_fd_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/ruby/library/socket/unixserver/for_fd_spec.rb b/spec/ruby/library/socket/unixserver/for_fd_spec.rb
new file mode 100644
index 0000000000..be1c2df4d7
--- /dev/null
+++ b/spec/ruby/library/socket/unixserver/for_fd_spec.rb
@@ -0,0 +1,21 @@
+require_relative '../spec_helper'
+require_relative '../fixtures/classes'
+
+describe "UNIXServer.for_fd" do
+ before :each do
+ @unix_path = SocketSpecs.socket_path
+ @unix = UNIXServer.new(@unix_path)
+ end
+
+ after :each do
+ @unix.close if @unix
+ SocketSpecs.rm_socket @unix_path
+ end
+
+ it "can calculate the path" do
+ b = UNIXServer.for_fd(@unix.fileno)
+ b.autoclose = false
+
+ b.path.should == @unix_path
+ end
+end