Last active
August 29, 2015 13:56
-
-
Save myers/9122856 to your computer and use it in GitHub Desktop.
Revisions
-
myers revised this gist
Feb 20, 2014 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ 1) test create new session (SessionHerderTest) ** (MatchError) no match of right hand side value: {:error, {:already_started, #PID<0.117.0>}} stacktrace: test/session_herder_test.ex:6: SessionHerderTest.__ex_unit_setup_0/1 test/session_herder_test.ex:1: SessionHerderTest.__ex_unit__/2 -
myers created this gist
Feb 20, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ defmodule SessionHerderTest do use ExUnit.Case setup do {:ok, sup_pid} = Chat.SessionSupervisor.start_link {:ok, herder_pid} = Chat.SessionHerder.start_link {:ok, pids: [sup_pid, herder_pid]} end teardown config do IO.puts inspect(config[:pids]) Enum.each config[:pids], &:erlang.exit(&1, :kill) :ok end test "create new session" do {:ok, session_id} = Chat.SessionHerder.new assert is_binary(session_id) assert Chat.SessionHerder.count == 1 end test "reconnect old session" do {:ok, session_id} = Chat.SessionHerder.new assert is_binary(session_id) assert Chat.SessionHerder.count == 1 :ok = Chat.SessionHerder.reconnect(session_id) end end