Module: TestPuma
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Classes:
| |
Defined in: | test/helpers/test_puma.rb, test/helpers/test_puma/assertions.rb, test/helpers/test_puma/puma_socket.rb, test/helpers/test_puma/response.rb |
Constant Summary
-
ALT_HOST =
# File 'test/helpers/test_puma.rb', line 34HOST6
-
DARWIN =
# File 'test/helpers/test_puma.rb', line 40RUBY_PLATFORM.include? 'darwin'
-
HOST =
# File 'test/helpers/test_puma.rb', line 33HOST4
-
HOST4 =
# File 'test/helpers/test_puma.rb', line 12begin t = Socket.ip_address_list.select(&:ipv4_loopback?).map(&:ip_address) .uniq.sort_by(&:length) # puts "IPv4 Loopback #{t}" str = t.include?('127.0.0.1') ? +'127.0.0.1' : +"#{t.first}" str.define_singleton_method(:ip) { self } str.freeze end
-
HOST6 =
# File 'test/helpers/test_puma.rb', line 21begin t = Socket.ip_address_list.select(&:ipv6_loopback?).map(&:ip_address) .uniq.sort_by(&:length) # puts "IPv6 Loopback #{t}" str = t.include?('::1') ? +'[::1]' : +"[#{t.first}]" str.define_singleton_method(:ip) { self.gsub RE_HOST_TO_IP, '' } str.freeze end
-
LINE_SPLIT =
# File 'test/helpers/test_puma.rb', line 8"\r\n"
-
LOCALHOST =
# File 'test/helpers/test_puma.rb', line 30ENV.fetch 'PUMA_CI_DFLT_HOST', 'localhost'
-
RESP_SPLIT =
# File 'test/helpers/test_puma.rb', line 7"\r\n\r\n"
-
RE_HOST_TO_IP =
# File 'test/helpers/test_puma.rb', line 10/\A\[|\]\z/o
-
TOKEN =
# File 'test/helpers/test_puma.rb', line 42"xxyyzz"
Instance Method Summary
- #bind_uri_str
- #control_uri_str
-
#new_port(host = HOST)
Returns an available port by using
TCPServer.open(host, 0)
.
Instance Method Details
#bind_uri_str
[ GitHub ]#control_uri_str
[ GitHub ]#new_port(host = HOST)
Returns an available port by using TCPServer.open(host, 0)
# File 'test/helpers/test_puma.rb', line 45
def new_port(host = HOST) TCPServer.open(host, 0) { |server| server.connect_address.ip_port } end