mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
using http helpers for unix as well
This commit is contained in:
parent
ad8105afd6
commit
198659ef12
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user