Skip to content

Commit cd5b885

Browse files
committed
fix: ensure use Oban.Pro.Testing does not appear w/o pro
1 parent 761d294 commit cd5b885

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lib/test.ex

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ defmodule AshOban.Test do
6767
refute_would_schedule(processed, :process)
6868
"""
6969

70+
@pro Application.compile_env(:ash_oban, :pro?)
71+
7072
@doc """
7173
Sets up AshOban test helpers.
7274
@@ -83,13 +85,16 @@ defmodule AshOban.Test do
8385
use AshOban.Test, repo: MyApp.Repo, prefix: "private"
8486
"""
8587
defmacro __using__(opts) do
86-
quote do
87-
if Application.compile_env(:ash_oban, :pro?) do
88-
use Oban.Pro.Testing, unquote(opts)
88+
module =
89+
if @pro do
90+
Oban.Pro.Testing
8991
else
90-
use Oban.Testing, unquote(opts)
92+
Oban.Testing
9193
end
9294

95+
quote do
96+
use unquote(module), unquote(opts)
97+
9398
import AshOban.Test
9499
end
95100
end

0 commit comments

Comments
 (0)