Skip to content

Commit a01fd62

Browse files
committed
add child_spec tests
1 parent 5dd4b9a commit a01fd62

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Created by Boyd Multerer on 2020-11-02.
3+
# Copyright © 2020 Kry10 Limited. All rights reserved.
4+
#
5+
6+
# putting read and load in separate modules (both in this file)
7+
# because load needs the cache to be set up and read doesn't.
8+
9+
defmodule Scenic.Cache.Support.SupervisorTest do
10+
use ExUnit.Case, async: true
11+
doctest Scenic.Cache.Support.Supervisor
12+
13+
alias Scenic.Cache.Support.Supervisor, as: Super
14+
15+
# ============================================================================
16+
17+
test "child_spec is as expected" do
18+
assert Super.child_spec() == %{
19+
id: Super,
20+
start: {Super, :start_link, nil},
21+
type: :supervisor,
22+
restart: :permanent,
23+
shutdown: 500
24+
}
25+
end
26+
end
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Created by Boyd Multerer on 2020-11-02.
3+
# Copyright © 2020 Kry10 Limited. All rights reserved.
4+
#
5+
6+
# putting read and load in separate modules (both in this file)
7+
# because load needs the cache to be set up and read doesn't.
8+
9+
defmodule Scenic.ViewPort.SupervisorTopTest do
10+
use ExUnit.Case, async: true
11+
doctest Scenic.ViewPort.SupervisorTop
12+
13+
alias Scenic.ViewPort.SupervisorTop, as: Super
14+
15+
# ============================================================================
16+
17+
test "child_spec is as expected" do
18+
list = [1, 2, 3]
19+
20+
assert Super.child_spec(list) == %{
21+
id: Super,
22+
start: {Super, :start_link, list},
23+
type: :supervisor,
24+
restart: :permanent,
25+
shutdown: 500
26+
}
27+
end
28+
end

0 commit comments

Comments
 (0)