mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-21 05:53:18 +12:00
29 lines
473 B
Elixir
29 lines
473 B
Elixir
|
defmodule AshPostgres.RepoCase do
|
||
|
@moduledoc false
|
||
|
use ExUnit.CaseTemplate
|
||
|
|
||
|
alias Ecto.Adapters.SQL.Sandbox
|
||
|
|
||
|
using do
|
||
|
quote do
|
||
|
alias AshPostgres.TestRepo
|
||
|
|
||
|
import Ecto
|
||
|
import Ecto.Query
|
||
|
import AshPostgres.RepoCase
|
||
|
|
||
|
# and any other stuff
|
||
|
end
|
||
|
end
|
||
|
|
||
|
setup tags do
|
||
|
:ok = Sandbox.checkout(AshPostgres.TestRepo)
|
||
|
|
||
|
unless tags[:async] do
|
||
|
Sandbox.mode(AshPostgres.TestRepo, {:shared, self()})
|
||
|
end
|
||
|
|
||
|
:ok
|
||
|
end
|
||
|
end
|