Remove tests for dropped register functionality
COUCHDB-2561
diff --git a/test/config_tests.erl b/test/config_tests.erl
index 256ba99..636cb05 100644
--- a/test/config_tests.erl
+++ b/test/config_tests.erl
@@ -50,32 +50,6 @@
setup_empty() ->
setup([]).
-setup_register() ->
- ConfigPid = setup(),
- SentinelFunc = fun() ->
- % Ping/Pong to make sure we wait for this
- % process to die
- receive
- {ping, From} ->
- From ! pong
- end
- end,
- SentinelPid = spawn(SentinelFunc),
- {ConfigPid, SentinelPid}.
-
-teardown({ConfigPid, SentinelPid}) ->
- teardown(ConfigPid),
- case process_info(SentinelPid) of
- undefined -> ok;
- _ ->
- SentinelPid ! {ping, self()},
- receive
- pong ->
- ok
- after 100 ->
- throw({timeout_error, registered_pid})
- end
- end;
teardown(Pid) ->
config:stop(),
[ok = application:stop(App) || App <- ?DEPS],
@@ -99,7 +73,6 @@
%% config_del_tests(),
config_override_tests()
%% config_persistent_changes_tests(),
- %% config_register_tests(),
%% config_no_files_tests()
]
}.
@@ -188,21 +161,6 @@
}
}.
-config_register_tests() ->
- {
- "Config changes subscriber",
- {
- foreach,
- fun setup_register/0, fun teardown/1,
- [
- fun should_handle_port_changes/1,
- fun should_pass_persistent_flag/1,
- fun should_not_trigger_handler_on_other_options_changes/1,
- fun should_not_trigger_handler_after_related_process_death/1
- ]
- }
- }.
-
config_no_files_tests() ->
{
"Test config with no files",
@@ -347,108 +305,6 @@
config:get("httpd", "bind_address"))
end).
-should_handle_port_changes({_, SentinelPid}) ->
- ?_assert(begin
- MainProc = self(),
- Port = "8080",
-
- config:register(
- fun("httpd", "port", Value) ->
- % config catches every error raised from handler
- % so it's not possible to just assert on wrong value.
- % We have to return the result as message
- MainProc ! (Value =:= Port)
- end,
- SentinelPid
- ),
- ok = config:set("httpd", "port", Port, false),
-
- receive
- R ->
- R
- after ?TIMEOUT ->
- erlang:error({assertion_failed,
- [{module, ?MODULE},
- {line, ?LINE},
- {reason, "Timeout"}]})
- end
- end).
-
-should_pass_persistent_flag({_, SentinelPid}) ->
- ?_assert(begin
- MainProc = self(),
-
- config:register(
- fun("httpd", "port", _, Persist) ->
- % config catches every error raised from handler
- % so it's not possible to just assert on wrong value.
- % We have to return the result as message
- MainProc ! Persist
- end,
- SentinelPid
- ),
- ok = config:set("httpd", "port", "8080", false),
-
- receive
- false ->
- true
- after ?SHORT_TIMEOUT ->
- false
- end
- end).
-
-should_not_trigger_handler_on_other_options_changes({_, SentinelPid}) ->
- ?_assert(begin
- MainProc = self(),
-
- config:register(
- fun("httpd", "port", _) ->
- MainProc ! ok
- end,
- SentinelPid
- ),
- ok = config:set("httpd", "bind_address", "0.0.0.0", false),
-
- receive
- ok ->
- false
- after ?SHORT_TIMEOUT ->
- true
- end
- end).
-
-should_not_trigger_handler_after_related_process_death({_, SentinelPid}) ->
- ?_assert(begin
- MainProc = self(),
-
- config:register(
- fun("httpd", "port", _) ->
- MainProc ! ok
- end,
- SentinelPid
- ),
-
- SentinelPid ! {ping, MainProc},
- receive
- pong ->
- ok
- after ?SHORT_TIMEOUT ->
- erlang:error({assertion_failed,
- [{module, ?MODULE},
- {line, ?LINE},
- {reason, "Timeout"}]})
- end,
-
- ok = config:set("httpd", "port", "12345", false),
-
- receive
- ok ->
- false
- after ?SHORT_TIMEOUT ->
- true
- end
- end).
-
should_ensure_that_no_ini_files_loaded() ->
?_assertEqual(0, length(config:all())).