Test isolation for Cachex. Each test gets its own clean cache.
# mix.exs
{:cachex_sandbox, "~> 0.1", only: :test}
# test/test_helper.exs
CachexSandbox.start([:my_cache])use ExUnit.Case, async: true
use CachexSandbox.Case
test "isolated cache", %{caches: caches} do
Cachex.put(caches[:my_cache], "key", "value")
# Other tests won't see this
endYour app reads the cache name from config:
def cache_name, do: Application.get_env(:my_app, :cache, :my_cache)