TemporaryEnv
Temporarily set Application environment variables.
Quite handy for testing, but remember to set async: false
for tests suites
it is used in.
Summary
Macros
Temporarily set an Application environment value within a block
Macros
Specs
set(term, atom, [{atom, any}], [{:do, any}]) :: any
Temporarily set an Application environment value within a block.
TemporaryEnv.set :my_app, greeting: "Hello!" do
# :greeting for :my_app is now "Hello"
end
# :greeting for :my_app is back to its original value
This does modify global state, so do not use it in an async situation.