diff options
Diffstat (limited to 'src/ruby/spec/port_picker.rb')
-rw-r--r-- | src/ruby/spec/port_picker.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ruby/spec/port_picker.rb b/src/ruby/spec/port_picker.rb index 1b52113e10..98ffbacc1b 100644 --- a/src/ruby/spec/port_picker.rb +++ b/src/ruby/spec/port_picker.rb @@ -32,7 +32,7 @@ require 'socket' # @param [Fixnum] the minimum port number to accept # @param [Fixnum] the maximum port number to accept # @return [Fixnum ]a free tcp port -def find_unused_tcp_port(min=32768, max=60000) +def find_unused_tcp_port(min = 32_768, max = 60_000) # Allow the system to assign a port, by specifying 0. # Loop until a port is assigned in the required range loop do @@ -40,6 +40,6 @@ def find_unused_tcp_port(min=32768, max=60000) socket.bind(Addrinfo.tcp('127.0.0.1', 0)) p = socket.local_address.ip_port socket.close - return p if p > min and p < 60000 + return p if p > min && p < max end end |