X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Fhelpers.ex;h=ecd4b1e185889cb5b3398511f7fb804a2d2a7aad;hb=c5efded5fd5d3e75990f694088ad15de76e8d83f;hp=7d729541dc3432ec27dc83e8448050cd508a2c74;hpb=56e9bf33932bacfdffd700b97e3117fc593cac11;p=akkoma diff --git a/test/support/helpers.ex b/test/support/helpers.ex index 7d729541d..ecd4b1e18 100644 --- a/test/support/helpers.ex +++ b/test/support/helpers.ex @@ -17,16 +17,16 @@ defmodule Pleroma.Tests.Helpers do defmacro clear_config(config_path, do: yield) do quote do - initial_setting = Config.get(unquote(config_path), :__clear_config_absent__) + initial_setting = Config.fetch(unquote(config_path)) unquote(yield) on_exit(fn -> case initial_setting do - :__clear_config_absent__ -> + :error -> Config.delete(unquote(config_path)) - _ -> - Config.put(unquote(config_path), initial_setting) + {:ok, value} -> + Config.put(unquote(config_path), value) end end)