summaryrefslogtreecommitdiff
path: root/src/ddoc_cache
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2019-08-18 09:33:25 -0400
committerAdam Kocoloski <kocolosk@apache.org>2019-08-18 20:56:05 -0400
commitadc0315ecdb37a30ebb3eeaada70143ebe7dbd70 (patch)
tree4f9440f7594ba9bb1c378b4d1e840b8280073a10 /src/ddoc_cache
parent69275859c6a4840e127c5ba30e756a7640d5cfd5 (diff)
downloadcouchdb-adc0315ecdb37a30ebb3eeaada70143ebe7dbd70.tar.gz
Refactor test to keep setup/teardown out of timer
Diffstat (limited to 'src/ddoc_cache')
-rw-r--r--src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl b/src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl
index e37f1c090..9a5391587 100644
--- a/src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl
+++ b/src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl
@@ -47,14 +47,17 @@ stop_couch(Ctx) ->
check_not_started_test() ->
% Starting couch, but not ddoc_cache
- Ctx = test_util:start_couch(),
- try
- Key = {ddoc_cache_entry_custom, {<<"dbname">>, ?MODULE}},
- ?assertEqual({ok, <<"dbname">>}, ddoc_cache_lru:open(Key))
- after
- test_util:stop_couch(Ctx)
- end.
-
+ {
+ setup,
+ fun test_util:start_couch/0,
+ fun test_util:stop_couch/1,
+ [
+ fun(_) ->
+ Key = {ddoc_cache_entry_custom, {<<"dbname">>, ?MODULE}},
+ ?assertEqual({ok, <<"dbname">>}, ddoc_cache_lru:open(Key))
+ end
+ ]
+ }.
check_lru_test_() ->
{