diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2019-12-25 11:40:48 -0600 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2019-12-25 13:52:32 -0600 |
commit | de41a57e2c0744e9578456ab26e690581c440c1b (patch) | |
tree | 90420119e721227570fea7e25717f11bbcb247f1 | |
parent | 5ef62644b7d7b82cf16b8dd9165da82a193a05ef (diff) | |
download | couchdb-de41a57e2c0744e9578456ab26e690581c440c1b.tar.gz |
Speedup eunit: fabric_doc_open
-rw-r--r-- | src/fabric/src/fabric_doc_open.erl | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/src/fabric/src/fabric_doc_open.erl b/src/fabric/src/fabric_doc_open.erl index 743ad8c74..8ef604b60 100644 --- a/src/fabric/src/fabric_doc_open.erl +++ b/src/fabric/src/fabric_doc_open.erl @@ -185,38 +185,53 @@ format_reply(Else, _) -> -ifdef(TEST). -include_lib("eunit/include/eunit.hrl"). +-define(MECK_MODS, [ + couch_log, + couch_stats, + fabric, + fabric_util, + mem3, + rexi, + rexi_monitor +]). + + +setup_all() -> + meck:new(?MECK_MODS, [passthrough]). + + +teardown_all(_) -> + meck:unload(). + setup() -> - meck:new([ - couch_log, - couch_stats, - fabric, - fabric_util, - mem3, - rexi, - rexi_monitor - ], [passthrough]). + meck:reset(?MECK_MODS). teardown(_) -> - meck:unload(). + ok. open_doc_test_() -> { - foreach, - fun setup/0, - fun teardown/1, - [ - t_is_r_met(), - t_handle_message_down(), - t_handle_message_exit(), - t_handle_message_reply(), - t_store_node_revs(), - t_read_repair(), - t_handle_response_quorum_met(), - t_get_doc_info() - ] + setup, + fun setup_all/0, + fun teardown_all/1, + { + foreach, + fun setup/0, + fun teardown/1, + [ + t_is_r_met(), + t_handle_message_down(), + t_handle_message_exit(), + t_handle_message_reply(), + t_store_node_revs(), + t_read_repair(), + t_handle_response_quorum_met(), + t_get_doc_info() + ] + } }. |