Sha256: a5b37acf8dbe609418b67794afe9158c39ab6253985980cf12c47533dde3ed9e

Contents?: true

Size: 782 Bytes

Versions: 4

Compression:

Stored size: 782 Bytes

Contents

require File.expand_path('../spec_helper', __FILE__)
require 'tempfile'

describe Cool.io::UNIXServer, :env => :win do

  before :each do
    @tmp = Tempfile.new('coolio_unix_server_spec')
    File.unlink(@tmp.path).should == 1
    File.exist?(@tmp.path).should == false
  end

  it "creates a new Cool.io::UNIXServer" do
    listener = Cool.io::UNIXListener.new(@tmp.path)
    listener.listen(24)
    File.socket?(@tmp.path).should == true
  end

  it "builds off an existing ::UNIXServer" do
    unix_server = ::UNIXServer.new(@tmp.path)
    File.socket?(@tmp.path).should == true
    listener = Cool.io::UNIXServer.new(unix_server, Coolio::UNIXSocket)
    listener.listen(24)
    File.socket?(@tmp.path).should == true
    listener.fileno.should == unix_server.fileno
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cool.io-1.2.3-x86-mingw32 spec/unix_server_spec.rb
cool.io-1.2.3 spec/unix_server_spec.rb
cool.io-1.2.2 spec/unix_server_spec.rb
cool.io-1.2.1 spec/unix_server_spec.rb