diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2019-08-18 09:33:25 -0400 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2019-08-18 18:56:31 -0400 |
commit | 42efd5a10f2457756a31859d77db7fd9282271e0 (patch) | |
tree | 4f9440f7594ba9bb1c378b4d1e840b8280073a10 | |
parent | 509e5048750556ecd4c9607fe423ae4cd61cce04 (diff) | |
download | couchdb-jenkins-elixir-retry-until-flakes.tar.gz |
Refactor test to keep setup/teardown out of timerjenkins-elixir-retry-until-flakes
-rw-r--r-- | src/ddoc_cache/test/eunit/ddoc_cache_lru_test.erl | 19 |
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_() -> { |