You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/02/22 16:06:05 UTC

[3/5] chttpd commit: updated refs/heads/COUCHDB-3288-remove-public-db-record to 27cadc5

Mock config module in tests

The tests in chttpd_db_bulk_get_test do not start config app.
The change in https://github.com/apache/couchdb-couch/pull/226
introduces call to config app.
Make sure we mock config so the tests pass.

COUCHDB-3293


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/cae3664d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/cae3664d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/cae3664d

Branch: refs/heads/COUCHDB-3288-remove-public-db-record
Commit: cae3664d6583adf110302704fb546b4565e19b91
Parents: 928bb2e
Author: ILYA Khlopotov <ii...@apache.org>
Authored: Thu Feb 9 13:36:39 2017 -0800
Committer: ILYA Khlopotov <ii...@apache.org>
Committed: Thu Feb 9 13:57:42 2017 -0800

----------------------------------------------------------------------
 test/chttpd_db_bulk_get_test.erl | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/cae3664d/test/chttpd_db_bulk_get_test.erl
----------------------------------------------------------------------
diff --git a/test/chttpd_db_bulk_get_test.erl b/test/chttpd_db_bulk_get_test.erl
index a5edcc0..f892131 100644
--- a/test/chttpd_db_bulk_get_test.erl
+++ b/test/chttpd_db_bulk_get_test.erl
@@ -19,6 +19,7 @@
 
 
 setup() ->
+    mock(config),
     mock(chttpd),
     mock(couch_epi),
     mock(couch_httpd),
@@ -31,6 +32,7 @@ setup() ->
 
 teardown(Pid) ->
     ok = stop_accumulator(Pid),
+    meck:unload(config),
     meck:unload(chttpd),
     meck:unload(couch_epi),
     meck:unload(couch_httpd),
@@ -270,6 +272,10 @@ mock(couch_stats) ->
     ok;
 mock(fabric) ->
     ok = meck:new(fabric, [passthrough]),
+    ok;
+mock(config) ->
+    ok = meck:new(config, [passthrough]),
+    ok = meck:expect(config, get, fun(_, _, Default) -> Default end),
     ok.