nickva commented on code in PR #4662:
URL: https://github.com/apache/couchdb/pull/4662#discussion_r1305054596


##########
src/mango/src/mango_idx.erl:
##########
@@ -479,7 +500,186 @@ get_legacy_selector(Def) ->
     end.
 
 -ifdef(TEST).
--include_lib("eunit/include/eunit.hrl").
+-include_lib("couch/include/couch_eunit.hrl").
+
+get_usable_indexes_test_() ->
+    {
+        foreach,
+        fun() ->
+            meck:new(fabric_util),
+            meck:new(ddoc_cache),
+            meck:new(mango_idx_special),
+            meck:new(mango_idx_view),
+            meck:new(mango_sort),
+            meck:new(mango_cursor)
+        end,
+        fun(_) ->
+            meck:unload(mango_cursor),
+            meck:unload(mango_sort),
+            meck:unload(mango_idx_view),
+            meck:unload(mango_idx_special),
+            meck:unload(ddoc_cache),
+            meck:unload(fabric_util)

Review Comment:
   Let's just do `meck:unload()` so we don't have keep track of all the 
modules. This might work alongside the idea that meck automatically initializes 
the mock on first `expect` call, so then we don't have to keep track of mocked 
module to unmock them either, just call `meck:unload()` in teardown and setup 
can be just an `ok` no-op call.



-- 
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