Use aliases

This commit is contained in:
Claudio Ortolina
2025-02-20 15:19:06 +00:00
parent 26297a8bb1
commit b2daa561d7
4 changed files with 19 additions and 15 deletions
+4 -2
View File
@@ -16,6 +16,8 @@ defmodule MusicLibrary.DataCase do
use ExUnit.CaseTemplate
alias Ecto.Adapters.SQL.Sandbox
using do
quote do
alias MusicLibrary.Repo
@@ -36,8 +38,8 @@ defmodule MusicLibrary.DataCase do
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(MusicLibrary.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(MusicLibrary.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
end
@doc """