Skip to content

Commit

Permalink
Use start_supervised! within tests
Browse files Browse the repository at this point in the history
...instead of changing application.ex
  • Loading branch information
metavida committed Aug 7, 2023
1 parent 7b183f9 commit 3121718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/mox/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ defmodule Mox.Application do
use Application

def start(_, _) do
children = [
Mox.Server,
{Task.Supervisor, name: MoxTests.TaskSupervisor},
]
children = [Mox.Server]
Supervisor.start_link(children, name: Mox.Supervisor, strategy: :one_for_one)
end
end
2 changes: 2 additions & 0 deletions test/mox_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ defmodule MoxTest do
end

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

verify!()
Expand Down Expand Up @@ -485,6 +486,7 @@ defmodule MoxTest do
end

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

verify!()
Expand Down

0 comments on commit 3121718

Please sign in to comment.