- @doc "Stores initial config value and restores it after *all* test examples are executed."
- defmacro clear_config_all(config_path) do
- quote do
- clear_config_all(unquote(config_path)) do
- end
+ defmacro clear_config(config_path, temp_setting) do
+ # NOTE: `clear_config([section, key], value)` != `clear_config([section], key: value)` (!)
+ # Displaying a warning to prevent unintentional clearing of all but one keys in section
+ if Keyword.keyword?(temp_setting) and length(temp_setting) == 1 do
+ Logger.warn(
+ "Please change to `clear_config([section]); clear_config([section, key], value)`: " <>
+ "#{inspect(config_path)}, #{inspect(temp_setting)}"
+ )