diff options
Diffstat (limited to 'spec/ruby/library/socket/unixserver/for_fd_spec.rb')
-rw-r--r-- | spec/ruby/library/socket/unixserver/for_fd_spec.rb | 23 |
1 files changed, 23 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..c3cfd86a1c --- /dev/null +++ b/spec/ruby/library/socket/unixserver/for_fd_spec.rb @@ -0,0 +1,23 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require File.expand_path('../../fixtures/classes', __FILE__) + +platform_is_not :windows do + 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 +end |