diff --git a/lib/oban.ex b/lib/oban.ex index 9543bec4..9589e024 100644 --- a/lib/oban.ex +++ b/lib/oban.ex @@ -49,7 +49,7 @@ defmodule Oban do | {:notifier, module() | {module(), Keyword.t()}} | {:peer, false | module() | {module(), Keyword.t()}} | {:plugins, false | [module() | {module() | Keyword.t()}]} - | {:prefix, String.t()} + | {:prefix, false | String.t()} | {:queues, false | [{queue_name(), pos_integer() | Keyword.t()}]} | {:repo, module()} | {:shutdown_grace_period, timeout()} diff --git a/lib/oban/testing.ex b/lib/oban/testing.ex index fb0d5104..96ef935d 100644 --- a/lib/oban/testing.ex +++ b/lib/oban/testing.ex @@ -103,11 +103,7 @@ defmodule Oban.Testing do alias Oban.{Config, Job, Queue.Executor, Repo, Worker} - @type perform_opts :: - Job.option() - | {:log, Logger.level()} - | {:prefix, binary()} - | {:repo, module()} + @type perform_opts :: Job.option() | Oban.option() @conf_keys [] |> Config.new() @@ -120,7 +116,11 @@ defmodule Oban.Testing do @doc false defmacro __using__(repo_opts) do - _repo = Keyword.fetch!(repo_opts, :repo) + repo_opts = Keyword.put_new(repo_opts, :prefix, false) + + unless Keyword.has_key?(repo_opts, :repo) do + raise ArgumentError, "testing requires a :repo option to be set" + end quote do alias Oban.Testing diff --git a/test/oban/testing_test.exs b/test/oban/testing_test.exs index a3e8aa95..d4b0521c 100644 --- a/test/oban/testing_test.exs +++ b/test/oban/testing_test.exs @@ -1,7 +1,7 @@ defmodule Oban.TestingTest do use Oban.Case, async: true - use Oban.Testing, repo: Oban.Test.Repo, prefix: "public", log: false + use Oban.Testing, repo: Oban.Test.Repo, log: false alias Oban.{TelemetryHandler, Testing}