Skip to content

Commit 3121718

Browse files
committed
Use start_supervised! within tests
...instead of changing application.ex
1 parent 7b183f9 commit 3121718

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/mox/application.ex

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ defmodule Mox.Application do
44
use Application
55

66
def start(_, _) do
7-
children = [
8-
Mox.Server,
9-
{Task.Supervisor, name: MoxTests.TaskSupervisor},
10-
]
7+
children = [Mox.Server]
118
Supervisor.start_link(children, name: Mox.Supervisor, strategy: :one_for_one)
129
end
1310
end

test/mox_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ defmodule MoxTest do
405405
end
406406

407407
test "verifies mocks are over-called for the current process in global mode" do
408+
start_supervised!({Task.Supervisor, name: MoxTests.TaskSupervisor})
408409
set_mox_global()
409410

410411
verify!()
@@ -485,6 +486,7 @@ defmodule MoxTest do
485486
end
486487

487488
test "verifies mocks are over-called for the current process in global mode" do
489+
start_supervised!({Task.Supervisor, name: MoxTests.TaskSupervisor})
488490
set_mox_global()
489491

490492
verify!()

0 commit comments

Comments
 (0)