summaryrefslogtreecommitdiff
path: root/test/socket
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 06:30:12 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-30 06:30:12 +0000
commite16b8482c724f89bbf599185d2592f134bac8b45 (patch)
tree8ab8f7d3acee5bf993db2e99e1615ae88cbb1392 /test/socket
parent5efb130d3900dfb7fc577050eb5a6ef1c22eb78c (diff)
* ext/socket/unixsocket.c (rsock_init_unixsock): use rb_inspect()
because rb_sys_fail_str() fails if its argument contains NUL. * test/socket/test_unix.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket')
-rw-r--r--test/socket/test_unix.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index 90f641e..19efb32 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -548,6 +548,14 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
assert(s0.closed?)
end
+ def test_abstract_unix_socket_econnrefused
+ return if /linux/ !~ RUBY_PLATFORM
+ name = "\0ruby-test_unix"
+ assert_raise(Errno::ECONNREFUSED) do
+ UNIXSocket.open(name) {}
+ end
+ end
+
def test_abstract_unix_server_socket
return if /linux/ !~ RUBY_PLATFORM
name = "\0ruby-test_unix"