diff options
author | Paul J. Davis <paul.joseph.davis@gmail.com> | 2019-12-25 11:30:25 -0600 |
---|---|---|
committer | Paul J. Davis <paul.joseph.davis@gmail.com> | 2019-12-25 11:45:20 -0600 |
commit | 907647511187e1d1bbc87c2d8e8a01f15ccd45aa (patch) | |
tree | 993aa7ef4f50a02ac752938a125dd46dfff96eea | |
parent | 9f4a7f61c8e9d4c042eddfac97acd510d6f9a53e (diff) | |
download | couchdb-907647511187e1d1bbc87c2d8e8a01f15ccd45aa.tar.gz |
Speedup eunit: chttpd_view
-rw-r--r-- | src/chttpd/src/chttpd_view.erl | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/chttpd/src/chttpd_view.erl b/src/chttpd/src/chttpd_view.erl index 50704687e..f73a8b7b1 100644 --- a/src/chttpd/src/chttpd_view.erl +++ b/src/chttpd/src/chttpd_view.erl @@ -123,13 +123,18 @@ assert_no_queries_param(_) -> check_multi_query_reduce_view_overrides_test_() -> { - foreach, - fun setup/0, - fun teardown/1, - [ - t_check_include_docs_throw_validation_error(), - t_check_user_can_override_individual_query_type() - ] + setup, + fun setup_all/0, + fun teardown_all/1, + { + foreach, + fun setup/0, + fun teardown/1, + [ + t_check_include_docs_throw_validation_error(), + t_check_user_can_override_individual_query_type() + ] + } }. @@ -153,7 +158,7 @@ t_check_user_can_override_individual_query_type() -> end). -setup() -> +setup_all() -> Views = [#mrview{reduce_funs = [{<<"v">>, <<"_count">>}]}], meck:expect(couch_mrview_util, ddoc_to_mrst, 2, {ok, #mrst{views = Views}}), meck:expect(chttpd, start_delayed_json_response, 4, {ok, resp}), @@ -162,8 +167,20 @@ setup() -> meck:expect(chttpd, end_delayed_json_response, 1, ok). -teardown(_) -> +teardown_all(_) -> meck:unload(). +setup() -> + meck:reset([ + chttpd, + couch_mrview_util, + fabric + ]). + + +teardown(_) -> + ok. + + -endif. |