using http helpers for unix as well

This commit is contained in:
HoneyryderChuck 2020-03-14 01:02:21 +00:00
parent ad8105afd6
commit 198659ef12

View File

@ -4,17 +4,14 @@ require "tempfile"
require_relative "../test_helper"
class UnixTest < Minitest::Test
include HTTPX
include HTTPHelpers
def test_unix_session
skip if RUBY_ENGINE == "jruby"
on_unix_server do |path|
session = Session.new(transport: "unix", transport_options: { path: path })
response = session.get("http://unix.com/ping")
assert response.status == 200, "unexpected code (#{response.status})"
response = HTTPX.with(transport: "unix", transport_options: { path: path }).get("http://unix.com/ping")
verify_status(response, 200)
assert response.to_s == "pong", "unexpected body (#{response})"
response.close
session.close
end
end