Skip to content

Commit

Permalink
TestServer -> TestSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Aug 30, 2023
1 parent b7ee58a commit d8f1b63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/req/steps_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ defmodule Req.StepsTest do

test "multiple codecs with multiple headers" do
%{url: url} =
TestServer.serve(fn socket ->
TestSocket.serve(fn socket ->
assert {:ok, "GET / HTTP/1.1\r\n" <> _} = :gen_tcp.recv(socket, 0)

body = "foo" |> :zlib.gzip() |> :ezstd.compress()
Expand Down Expand Up @@ -1587,7 +1587,7 @@ defmodule Req.StepsTest do

test "into: fun" do
%{url: url} =
TestServer.serve(fn socket ->
TestSocket.serve(fn socket ->
{:ok, "GET / HTTP/1.1\r\n" <> _} = :gen_tcp.recv(socket, 0)

data = """
Expand Down Expand Up @@ -1687,7 +1687,7 @@ defmodule Req.StepsTest do

test "into: collectable" do
%{url: url} =
TestServer.serve(fn socket ->
TestSocket.serve(fn socket ->
{:ok, "GET / HTTP/1.1\r\n" <> _} = :gen_tcp.recv(socket, 0)

data = """
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule TestServer do
defmodule TestSocket do
def serve(fun) do
{:ok, listen_socket} = :gen_tcp.listen(0, mode: :binary, active: false)
{:ok, port} = :inet.port(listen_socket)
Expand Down

0 comments on commit d8f1b63

Please sign in to comment.