Skip to content

Commit

Permalink
Correct with_testing_mode examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sorentwo committed Apr 19, 2022
1 parent c540e55 commit b4fb01f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions guides/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For example, to switch to `:manual` mode when Oban is configured for `:inline`
testing:

```elixir
Oban.Testing.with_testing(:manual, fn ->
Oban.Testing.with_testing_mode(:manual, fn ->
Oban.insert(MyWorker.new(%{id: 123}))

assert_enqueued worker: MyWorker, args: %{id: 123}
Expand All @@ -56,7 +56,7 @@ Or visa-versa, switch to `:inline` mode when the application is configured for
`:manual` mode:

```elixir
Oban.Testing.with_testing(:inline, fn ->
Oban.Testing.with_testing_mode(:inline, fn ->
{:ok, %Job{state: "completed"}} = Oban.insert(MyWorker.new(%{id: 123}))
end)
```
Expand Down
4 changes: 2 additions & 2 deletions lib/oban/testing.ex
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@ defmodule Oban.Testing do
Switch to `:manual` mode when an Oban instance is configured for `:inline` testing:
Oban.Testing.with_testing(:manual, fn ->
Oban.Testing.with_testing_mode(:manual, fn ->
Oban.insert(MyWorker.new(%{id: 123}))
assert_enqueued worker: MyWorker, args: %{id: 123}
end)
Visa-versa, switch to `:inline` mode:
Oban.Testing.with_testing(:inline, fn ->
Oban.Testing.with_testing_mode(:inline, fn ->
{:ok, %Job{state: "completed"}} = Oban.insert(MyWorker.new(%{id: 123}))
end)
"""
Expand Down

0 comments on commit b4fb01f

Please sign in to comment.