How to write test for Oban config?

I want to write test case which fetch oban config values on application start. Test case fails if queues = false

What would that test actually “test”? Config usually does not contain logic and if certain config does start certain queues is something not you, but the oban project should test.

1 Like

Yes, i want to test Oban. Oban queues value is dynamically change on application start.
if Code.ensure_loaded?(IEx) and IEx.started?()

|> Keyword.put(:crontab, false)
|> Keyword.put(:queues, false)
I want fetch that queues value and write test case to check whether it is false or not.

The queues value isnt kept as false, it is converted to an empty list. You can verify that you aren’t running any queues like this:

assert %{queues: []} = Oban.config()

You’d be testing internals of Oban though, so I don’t recommend it.