Class: FakeStripe::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_stripe/utils.rb

Constant Summary collapse

FIND_AVAILABLE_PORT =
0

Class Method Summary collapse

Class Method Details

.find_available_portObject



7
8
9
10
11
12
# File 'lib/fake_stripe/utils.rb', line 7

def self.find_available_port
  server = TCPServer.new(FIND_AVAILABLE_PORT)
  server.addr[1]
ensure
  server.close if server
end