jaydoane commented on code in PR #4813:
URL: https://github.com/apache/couchdb/pull/4813#discussion_r1406958164


##########
src/config/test/config_tests.erl:
##########
@@ -115,6 +111,41 @@ handle_config_terminate(Self, Reason, {Pid, State}) ->
     Pid ! {config_msg, {Self, Reason, State}},
     ok.
 
+setup_ini(IniFiles) ->
+    Chain = [write_ini(F) || F <- IniFiles],
+    {Chain, setup(Chain)}.
+
+teardown_ini(_, {Chain, Apps}) ->
+    lists:foreach(
+        fun(Path) -> ok = file:delete(Path) end,
+        Chain
+    ),
+    teardown(Apps).
+
+write_ini(FileName) ->
+    Path = filename:join([?TEMPDIR, FileName]),
+    Data = io_lib:format("[section]\nfile = ~s\n", [FileName]),
+    ok = file:write_file(Path, Data),
+    Path.
+
+config_delete_reload_restart_test_() ->
+    {
+        "Test consistency after set, delete, reload, and restart",
+        foreachx,
+        fun setup_ini/1,
+        fun teardown_ini/2,
+        [
+            {
+                ["default.ini", "local.ini"],
+                fun non_persistent_set_delete_reload_restart/2

Review Comment:
   > My main beef with `foreachx` is that it becomes another eunit quirk one 
has to learn to be able add add or fix failing tests.
   
   I find it annoying that it requires `Pairs::[{X::any(), ((X::any(), 
R::any()) -> Tests)}]` instead of (say) an `Instantiator` that returns `Pairs`. 
But, yeah, I agree we can keep its use to a minimum. I've changed those tests 
back to `foreach`.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to