diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2020-08-29 22:28:04 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2020-08-29 22:43:12 -0400 |
commit | 126ff42d912dfea9e251e2b98bdcf8f295b8707e (patch) | |
tree | 5820307fc63e643e36b9534686c3585d5ad3b346 /test/support | |
parent | add module for handling .well-known (diff) |
make Polyjuice.Client.start_link return {:ok, pid}, like a normal start_link
add a function that returns a client struct from the pid, and add a stop
function to Polyjuice.Client.stop
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/dummy_client.ex | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/test/support/dummy_client.ex b/test/support/dummy_client.ex index 7c1556e..bc0d202 100644 --- a/test/support/dummy_client.ex +++ b/test/support/dummy_client.ex @@ -32,6 +32,11 @@ defmodule DummyClient do end def transaction_id(_), do: "txn_id" + + def stop(_, _, _) do + # don't need to do anything to stop it + :ok + end end defmodule MultiReq do @@ -47,14 +52,6 @@ defmodule DummyClient do } end - def destroy(%{pid: pid}) do - # make sure we weren't expecting any more requests - remaining = Agent.get(pid, & &1) - assert remaining == [] - - Process.exit(pid, :kill) - end - defimpl Polyjuice.Client.API do def call(%{pid: pid}, endpoint) do {request, result} = @@ -78,6 +75,15 @@ defmodule DummyClient do end def transaction_id(_), do: "txn_id" + + def stop(%{pid: pid}, _, _) do + # make sure we weren't expecting any more requests + remaining = Agent.get(pid, & &1) + assert remaining == [] + + Process.exit(pid, :kill) + :ok + end end end end |