-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule LiveOdds.Supervisor do | ||
@moduledoc false | ||
|
||
use Supervisor | ||
|
||
def start_link do | ||
Supervisor.start_link(__MODULE__, []) | ||
end | ||
|
||
def init([]) do | ||
children = [ | ||
worker(LiveOdds.Account, []), | ||
worker(PubSub, []), | ||
] | ||
|
||
supervise(children, strategy: :one_for_one) | ||
end | ||
end |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
defmodule SupervisorTest do | ||
|
||
use ExUnit.Case | ||
|
||
setup do | ||
{:ok, pid} = LiveOdds.Supervisor.start_link() | ||
{:ok, [pid: pid]} | ||
end | ||
|
||
test "it's alive!", %{pid: pid} do | ||
assert Process.alive?(pid) | ||
end | ||
|
||
test "starts Account and PubSub", %{pid: pid} do | ||
[{PubSub, _, _, _}, | ||
{LiveOdds.Account, _, _, _}, | ||
] = Supervisor.which_children(pid) | ||
end | ||
|
||
end |