Replace couch_log calls with mocks
Depending on the order of test suite invocations its possible that the
config suite will end up with -DTEST compiled versions from couch_log's
eunit test suite. These have syncrhonous calls where the normal versions
are all gen_server:cast/2 calls. This breaks config's test suite when
since couch_log is not started.
Rather than go through the hoops of getting couch_log started (which
causes a circular dependency) I've just mocked out the calls so that
they don't cause issues.
diff --git a/test/config_tests.erl b/test/config_tests.erl
index 7e39b9a..3e7e01f 100644
--- a/test/config_tests.erl
+++ b/test/config_tests.erl
@@ -66,6 +66,10 @@
setup(Chain ++ [?CONFIG_FIXTURE_TEMP]);
setup(Chain) ->
+ meck:new(couch_log),
+ meck:expect(couch_log, error, fun(_, _) -> ok end),
+ meck:expect(couch_log, notice, fun(_, _) -> ok end),
+ meck:expect(couch_log, debug, fun(_, _) -> ok end),
ok = application:set_env(config, ini_files, Chain),
test_util:start_applications([config]).
@@ -90,6 +94,7 @@
teardown(Apps);
teardown(Apps) when is_list(Apps) ->
+ meck:unload(),
test_util:stop_applications(Apps).
teardown(_, {Apps, Pid}) when is_pid(Pid) ->