rubysl-socket 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +0 -1
  3. data/.travis.yml +7 -0
  4. data/README.md +2 -2
  5. data/Rakefile +0 -1
  6. data/lib/rubysl/socket.rb +2 -0
  7. data/lib/rubysl/socket/socket.rb +1210 -0
  8. data/lib/{rubysl-socket → rubysl/socket}/version.rb +1 -1
  9. data/lib/socket.rb +1 -0
  10. data/rubysl-socket.gemspec +17 -18
  11. data/spec/addrinfo/afamily_spec.rb +5 -0
  12. data/spec/addrinfo/bind_spec.rb +5 -0
  13. data/spec/addrinfo/canonname_spec.rb +5 -0
  14. data/spec/addrinfo/connect_from_spec.rb +5 -0
  15. data/spec/addrinfo/connect_spec.rb +5 -0
  16. data/spec/addrinfo/connect_to_spec.rb +5 -0
  17. data/spec/addrinfo/family_addrinfo_spec.rb +5 -0
  18. data/spec/addrinfo/foreach_spec.rb +5 -0
  19. data/spec/addrinfo/getaddrinfo_spec.rb +5 -0
  20. data/spec/addrinfo/getnameinfo_spec.rb +5 -0
  21. data/spec/addrinfo/inspect_sockaddr_spec.rb +5 -0
  22. data/spec/addrinfo/inspect_spec.rb +5 -0
  23. data/spec/addrinfo/ip_address_spec.rb +5 -0
  24. data/spec/addrinfo/ip_port_spec.rb +5 -0
  25. data/spec/addrinfo/ip_spec.rb +9 -0
  26. data/spec/addrinfo/ip_unpack_spec.rb +5 -0
  27. data/spec/addrinfo/ipv4_loopback_spec.rb +5 -0
  28. data/spec/addrinfo/ipv4_multicast_spec.rb +5 -0
  29. data/spec/addrinfo/ipv4_private_spec.rb +5 -0
  30. data/spec/addrinfo/ipv4_spec.rb +5 -0
  31. data/spec/addrinfo/ipv6_linklocal_spec.rb +5 -0
  32. data/spec/addrinfo/ipv6_loopback_spec.rb +5 -0
  33. data/spec/addrinfo/ipv6_mc_global_spec.rb +5 -0
  34. data/spec/addrinfo/ipv6_mc_linklocal_spec.rb +5 -0
  35. data/spec/addrinfo/ipv6_mc_nodelocal_spec.rb +5 -0
  36. data/spec/addrinfo/ipv6_mc_orglocal_spec.rb +5 -0
  37. data/spec/addrinfo/ipv6_mc_sitelocal_spec.rb +5 -0
  38. data/spec/addrinfo/ipv6_multicast_spec.rb +5 -0
  39. data/spec/addrinfo/ipv6_sitelocal_spec.rb +5 -0
  40. data/spec/addrinfo/ipv6_spec.rb +5 -0
  41. data/spec/addrinfo/ipv6_to_ipv4_spec.rb +5 -0
  42. data/spec/addrinfo/ipv6_unspecified_spec.rb +5 -0
  43. data/spec/addrinfo/ipv6_v4compat_spec.rb +5 -0
  44. data/spec/addrinfo/ipv6_v4mapped_spec.rb +5 -0
  45. data/spec/addrinfo/listen_spec.rb +5 -0
  46. data/spec/addrinfo/marshal_dump_spec.rb +5 -0
  47. data/spec/addrinfo/marshal_load_spec.rb +5 -0
  48. data/spec/addrinfo/pfamily_spec.rb +5 -0
  49. data/spec/addrinfo/protocol_spec.rb +5 -0
  50. data/spec/addrinfo/socktype_spec.rb +5 -0
  51. data/spec/addrinfo/tcp_spec.rb +5 -0
  52. data/spec/addrinfo/to_s_spec.rb +5 -0
  53. data/spec/addrinfo/to_sockaddr_spec.rb +5 -0
  54. data/spec/addrinfo/udp_spec.rb +5 -0
  55. data/spec/addrinfo/unix_path_spec.rb +5 -0
  56. data/spec/addrinfo/unix_spec.rb +9 -0
  57. data/spec/basicsocket/close_read_spec.rb +42 -0
  58. data/spec/basicsocket/close_write_spec.rb +42 -0
  59. data/spec/basicsocket/do_not_reverse_lookup_spec.rb +78 -0
  60. data/spec/basicsocket/for_fd_spec.rb +37 -0
  61. data/spec/basicsocket/getpeername_spec.rb +24 -0
  62. data/spec/basicsocket/getsockname_spec.rb +27 -0
  63. data/spec/basicsocket/getsockopt_spec.rb +54 -0
  64. data/spec/basicsocket/ioctl_spec.rb +22 -0
  65. data/spec/basicsocket/recv_nonblock_spec.rb +6 -0
  66. data/spec/basicsocket/recv_spec.rb +76 -0
  67. data/spec/basicsocket/send_spec.rb +81 -0
  68. data/spec/basicsocket/setsockopt_spec.rb +333 -0
  69. data/spec/basicsocket/shutdown_spec.rb +5 -0
  70. data/spec/constants/constants_spec.rb +63 -0
  71. data/spec/fixtures/classes.rb +174 -0
  72. data/spec/fixtures/send_io.txt +1 -0
  73. data/spec/ipsocket/addr_spec.rb +72 -0
  74. data/spec/ipsocket/getaddress_spec.rb +26 -0
  75. data/spec/ipsocket/peeraddr_spec.rb +79 -0
  76. data/spec/ipsocket/recvfrom_spec.rb +64 -0
  77. data/spec/option/int_spec.rb +27 -0
  78. data/spec/option/linger_spec.rb +52 -0
  79. data/spec/option/new_spec.rb +32 -0
  80. data/spec/shared/pack_sockaddr.rb +26 -0
  81. data/spec/shared/partially_closable_sockets.rb +13 -0
  82. data/spec/shared/recv_nonblock.rb +33 -0
  83. data/spec/shared/socketpair.rb +35 -0
  84. data/spec/socket/accept_nonblock_spec.rb +27 -0
  85. data/spec/socket/accept_spec.rb +1 -0
  86. data/spec/socket/bind_spec.rb +80 -0
  87. data/spec/socket/connect_nonblock_spec.rb +62 -0
  88. data/spec/socket/connect_spec.rb +1 -0
  89. data/spec/socket/for_fd_spec.rb +29 -0
  90. data/spec/socket/getaddrinfo_spec.rb +120 -0
  91. data/spec/socket/gethostbyaddr_spec.rb +1 -0
  92. data/spec/socket/gethostbyname_spec.rb +26 -0
  93. data/spec/socket/gethostname_spec.rb +9 -0
  94. data/spec/socket/getnameinfo_spec.rb +57 -0
  95. data/spec/socket/getservbyname_spec.rb +24 -0
  96. data/spec/socket/listen_spec.rb +21 -0
  97. data/spec/socket/new_spec.rb +109 -0
  98. data/spec/socket/pack_sockaddr_in_spec.rb +6 -0
  99. data/spec/socket/pack_sockaddr_un_spec.rb +6 -0
  100. data/spec/socket/pair_spec.rb +6 -0
  101. data/spec/socket/recvfrom_nonblock_spec.rb +1 -0
  102. data/spec/socket/recvfrom_spec.rb +1 -0
  103. data/spec/socket/sockaddr_in_spec.rb +6 -0
  104. data/spec/socket/sockaddr_un_spec.rb +6 -0
  105. data/spec/socket/socket_spec.rb +37 -0
  106. data/spec/socket/socketpair_spec.rb +6 -0
  107. data/spec/socket/sysaccept_spec.rb +1 -0
  108. data/spec/socket/unpack_sockaddr_in_spec.rb +16 -0
  109. data/spec/socket/unpack_sockaddr_un_spec.rb +2 -0
  110. data/spec/tcpserver/accept_nonblock_spec.rb +30 -0
  111. data/spec/tcpserver/accept_spec.rb +60 -0
  112. data/spec/tcpserver/gets_spec.rb +17 -0
  113. data/spec/tcpserver/listen_spec.rb +1 -0
  114. data/spec/tcpserver/new_spec.rb +88 -0
  115. data/spec/tcpserver/output_spec.rb +8 -0
  116. data/spec/tcpserver/readpartial_spec.rb +8 -0
  117. data/spec/tcpserver/sysaccept_spec.rb +1 -0
  118. data/spec/tcpsocket/gethostbyname_spec.rb +62 -0
  119. data/spec/tcpsocket/new_spec.rb +5 -0
  120. data/spec/tcpsocket/open_spec.rb +5 -0
  121. data/spec/tcpsocket/partially_closable_spec.rb +20 -0
  122. data/spec/tcpsocket/recv_nonblock_spec.rb +31 -0
  123. data/spec/tcpsocket/setsockopt_spec.rb +49 -0
  124. data/spec/tcpsocket/shared/new.rb +85 -0
  125. data/spec/udpsocket/bind_spec.rb +33 -0
  126. data/spec/udpsocket/connect_spec.rb +1 -0
  127. data/spec/udpsocket/new_spec.rb +1 -0
  128. data/spec/udpsocket/open_spec.rb +12 -0
  129. data/spec/udpsocket/recvfrom_nonblock_spec.rb +1 -0
  130. data/spec/udpsocket/send_spec.rb +57 -0
  131. data/spec/unixserver/accept_nonblock_spec.rb +33 -0
  132. data/spec/unixserver/accept_spec.rb +64 -0
  133. data/spec/unixserver/for_fd_spec.rb +32 -0
  134. data/spec/unixserver/new_spec.rb +5 -0
  135. data/spec/unixserver/open_spec.rb +25 -0
  136. data/spec/unixserver/shared/new.rb +23 -0
  137. data/spec/unixsocket/addr_spec.rb +37 -0
  138. data/spec/unixsocket/new_spec.rb +5 -0
  139. data/spec/unixsocket/open_spec.rb +26 -0
  140. data/spec/unixsocket/pair_spec.rb +38 -0
  141. data/spec/unixsocket/partially_closable_spec.rb +25 -0
  142. data/spec/unixsocket/path_spec.rb +29 -0
  143. data/spec/unixsocket/peeraddr_spec.rb +29 -0
  144. data/spec/unixsocket/recv_io_spec.rb +40 -0
  145. data/spec/unixsocket/recvfrom_spec.rb +48 -0
  146. data/spec/unixsocket/send_io_spec.rb +30 -0
  147. data/spec/unixsocket/shared/new.rb +25 -0
  148. metadata +328 -89
  149. data/lib/rubysl-socket.rb +0 -7
@@ -1,5 +1,5 @@
1
1
  module RubySL
2
2
  module Socket
3
- VERSION = "0.0.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -0,0 +1 @@
1
+ require "rubysl/socket"
@@ -1,22 +1,21 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/rubysl-socket/version', __FILE__)
1
+ # coding: utf-8
2
+ require './lib/rubysl/socket/version'
3
3
 
4
- Gem::Specification.new do |gem|
5
- gem.authors = ["Brian Shirai"]
6
- gem.email = ["brixen@gmail.com"]
7
- gem.description = %q{Ruby Standard Library - socket}
8
- gem.summary = %q{Ruby Standard Library - socket}
9
- gem.homepage = ""
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "rubysl-socket"
6
+ spec.version = RubySL::Socket::VERSION
7
+ spec.authors = ["Brian Shirai"]
8
+ spec.email = ["brixen@gmail.com"]
9
+ spec.description = %q{Ruby standard library socket.}
10
+ spec.summary = %q{Ruby standard library socket.}
11
+ spec.homepage = "https://github.com/rubysl/rubysl-socket"
12
+ spec.license = "BSD"
10
13
 
11
- gem.files = `git ls-files`.split($\)
12
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
- gem.name = "rubysl-socket"
15
- gem.require_paths = ["lib"]
16
- gem.version = RubySL::Socket::VERSION
14
+ spec.files = `git ls-files`.split($/)
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ["lib"]
17
18
 
18
- gem.add_runtime_dependency "redcard", "~> 1.0"
19
-
20
- gem.add_development_dependency "rake", "~> 10.0"
21
- gem.add_development_dependency "mspec", "~> 1.5"
19
+ spec.add_development_dependency "bundler", "~> 1.3"
20
+ spec.add_development_dependency "rake", "~> 10.0"
22
21
  end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#afamily" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#bind" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#canonname" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#connect_from" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#connect" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#connect_to" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#family_addrinfo" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo.foreach" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo.getaddrinfo" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#getnameinfo" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#inspect_sockaddr" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#inspect" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ip_address" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ip_port" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo.ip" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
6
+
7
+ describe "Addrinfo#ip?" do
8
+ it "needs to be reviewed for spec completeness"
9
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ip_unpack" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv4_loopback?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv4_multicast?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv4_private?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv4?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_linklocal?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_loopback?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_mc_global?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_mc_linklocal?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_mc_nodelocal?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_mc_orglocal?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_mc_sitelocal?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_multicast?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_sitelocal?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_to_ipv4" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_unspecified?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_v4compat?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#ipv6_v4mapped?" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#listen" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#marshal_dump" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#marshal_load" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#pfamily" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#protocol" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#socktype" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo.tcp" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#to_s" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#to_sockaddr" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo.udp" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo#unix_path" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'socket'
2
+
3
+ describe "Addrinfo.unix" do
4
+ it "needs to be reviewed for spec completeness"
5
+ end
6
+
7
+ describe "Addrinfo#unix?" do
8
+ it "needs to be reviewed for spec completeness"
9
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path('../../fixtures/classes', __FILE__)
2
+
3
+ describe "Socket::BasicSocket#close_read" do
4
+ before :each do
5
+ @server = TCPServer.new(SocketSpecs.port)
6
+ end
7
+
8
+ after :each do
9
+ @server.close unless @server.closed?
10
+ end
11
+
12
+ it "closes the reading end of the socket" do
13
+ @server.close_read
14
+ lambda { @server.read }.should raise_error(IOError)
15
+ end
16
+
17
+ it "it works on sockets with closed ends" do
18
+ @server.close_read
19
+ lambda { @server.close_read }.should_not raise_error(Exception)
20
+ lambda { @server.read }.should raise_error(IOError)
21
+ end
22
+
23
+ it "does not close the socket" do
24
+ @server.close_read
25
+ @server.closed?.should be_false
26
+ end
27
+
28
+ it "fully closes the socket if it was already closed for writing" do
29
+ @server.close_write
30
+ @server.close_read
31
+ @server.closed?.should be_true
32
+ end
33
+
34
+ it "raises IOError on closed socket" do
35
+ @server.close
36
+ lambda { @server.close_read }.should raise_error(IOError)
37
+ end
38
+
39
+ it "returns nil" do
40
+ @server.close_read.should be_nil
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path('../../fixtures/classes', __FILE__)
2
+
3
+ describe "Socket::BasicSocket#close_write" do
4
+ before :each do
5
+ @server = TCPServer.new(SocketSpecs.port)
6
+ end
7
+
8
+ after :each do
9
+ @server.close unless @server.closed?
10
+ end
11
+
12
+ it "closes the writing end of the socket" do
13
+ @server.close_write
14
+ lambda { @server.write("foo") }.should raise_error(IOError)
15
+ end
16
+
17
+ it "works on sockets with closed write ends" do
18
+ @server.close_write
19
+ lambda { @server.close_write }.should_not raise_error(Exception)
20
+ lambda { @server.write("foo") }.should raise_error(IOError)
21
+ end
22
+
23
+ it "does not close the socket" do
24
+ @server.close_write
25
+ @server.closed?.should be_false
26
+ end
27
+
28
+ it "fully closes the socket if it was already closed for reading" do
29
+ @server.close_read
30
+ @server.close_write
31
+ @server.closed?.should be_true
32
+ end
33
+
34
+ it "raises IOError on closed socket" do
35
+ @server.close
36
+ lambda { @server.close_write }.should raise_error(IOError)
37
+ end
38
+
39
+ it "returns nil" do
40
+ @server.close_write.should be_nil
41
+ end
42
+ end