Skip to content

Commit 2b7953d

Browse files
committed
support all ruby versions
1 parent bdf35f7 commit 2b7953d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test/helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
require "logger"
66
require "stringio"
77

8+
(class Random; def self.rand(*args) super end; end) unless defined?(Random)
9+
810
begin
911
require "ruby-debug"
1012
rescue LoadError

test/internals_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def af_family_supported(af)
361361
begin
362362
tries = 5
363363
begin
364-
sa = Socket.pack_sockaddr_in(Random.rand(1024..65000), hosts[af])
364+
sa = Socket.pack_sockaddr_in(1024 + Random.rand(63076), hosts[af])
365365
s.bind(sa)
366366
rescue Errno::EADDRINUSE => e
367367
tries -= 1

0 commit comments

Comments
 (0)