Packages

A simple way to describe dependencies that can be replaced at test time.

Current section

Files

Jump to
injex lib injex.ex
Raw

lib/injex.ex

defmodule Injex do
defmacro inject(name, dep) do
if Mix.env == :test do
quote do
def unquote(name)() do
Application.get_env(__MODULE__, unquote(name), unquote(dep))
end
end
else
dep
end
end
end