summaryrefslogtreecommitdiff
path: root/test/polyjuice
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2020-04-25 13:47:57 -0400
committerHubert Chathi <hubert@uhoreg.ca>2020-04-25 13:47:57 -0400
commit6221884fe60cd1bc9e331b8b0c74a5d3937a87b0 (patch)
tree28272e7fbc382031a91e7211cb2bcbb099aef877 /test/polyjuice
parentadd information to function type (diff)
more unit tests
Diffstat (limited to 'test/polyjuice')
-rw-r--r--test/polyjuice/client_test.exs22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/polyjuice/client_test.exs b/test/polyjuice/client_test.exs
index de680a6..ecb539a 100644
--- a/test/polyjuice/client_test.exs
+++ b/test/polyjuice/client_test.exs
@@ -15,6 +15,28 @@
defmodule Polyjuice.ClientTest do
use ExUnit.Case
+ test "transaction_id is unique" do
+ client = %Polyjuice.Client{
+ base_url: "http://localhost:8008"
+ }
+
+ # the best that we can do is test that two calls to transaction_id return
+ # different values
+ assert Polyjuice.Client.API.transaction_id(client) !=
+ Polyjuice.Client.API.transaction_id(client)
+ end
+
+ test "sync child spec" do
+ client = %Polyjuice.Client{
+ base_url: "http://localhost:8008"
+ }
+
+ %{id: Polyjuice.Client.Sync, restart: :permanent, start: start} =
+ Polyjuice.Client.API.sync_child_spec(client, "listener")
+
+ assert start == {Polyjuice.Client.Sync, :start_link, [[client, "listener"]]}
+ end
+
test "sync" do
with client = %DummyClient{
response: {