summaryrefslogtreecommitdiff
path: root/spec/ruby/library/socket/fixtures/classes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/socket/fixtures/classes.rb')
-rw-r--r--spec/ruby/library/socket/fixtures/classes.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/ruby/library/socket/fixtures/classes.rb b/spec/ruby/library/socket/fixtures/classes.rb
index ebed66851d..786629d2ef 100644
--- a/spec/ruby/library/socket/fixtures/classes.rb
+++ b/spec/ruby/library/socket/fixtures/classes.rb
@@ -34,10 +34,12 @@ module SocketSpecs
def self.socket_path
path = tmp("unix.sock", false)
- # Check for too long unix socket path (max 108 bytes including \0 => 107)
+ # Check for too long unix socket path (max 104 bytes on macOS)
# Note that Linux accepts not null-terminated paths but the man page advises against it.
- if path.bytesize > 107
- path = "/tmp/unix_server_spec.socket"
+ if path.bytesize > 104
+ # rm_r in spec/mspec/lib/mspec/helpers/fs.rb fails against
+ # "/tmp/unix_server_spec.socket"
+ skip "too long unix socket path: #{path}"
end
rm_socket(path)
path
@@ -111,7 +113,7 @@ module SocketSpecs
begin
data = socket.recv(1024)
- return if data.empty?
+ return if data.nil? || data.empty?
log "SpecTCPServer received: #{data.inspect}"
return if data == "QUIT"