Skip to content

Commit

Permalink
cleaning up ejabberd_hooks_SUITE
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysGonchar committed Jul 13, 2021
1 parent 75b93b1 commit 2ec4c5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions test/ejabberd_hooks_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ init_per_suite(C) ->
end_per_suite(_C) ->
application:stop(exometer_core).

init_per_testcase(_, C) ->
gen_hook:start_link(),
catch ets:new(local_config, [named_table]),
C.

a_module_fun_can_be_added(_) ->
given_hooks_started(),
given_module(hook_mod, fun_a, fun(_) -> ok end),
Expand Down Expand Up @@ -242,7 +237,6 @@ exit_in_run_fold_is_ignored(_) ->
const(N) -> fun(_) -> N end.

given_hooks_started() ->
error_logger:tty(false),
Fun = fun(all_metrics_are_global) -> false end,
given_module(ejabberd_config, get_local_option, Fun),
gen_hook:start_link().
Expand Down
4 changes: 2 additions & 2 deletions test/gen_hook_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end_per_suite(Config) ->
application:stop(exometer_core),
Config.

init_per_testcase(_,Config) ->
init_per_testcase(_, Config) ->
Fun = fun(all_metrics_are_global) -> false end,
meck:new(ejabberd_config),
meck:expect(ejabberd_config, get_local_option, Fun),
Expand All @@ -50,7 +50,7 @@ single_handler_can_be_added_and_removed(_) ->
PlusHandlerFn = get_hook_handler(mod1, plus, fun hook_handler_plus/3),
MultiplyHandlerFn = get_hook_handler(mod2, multiply, fun hook_handler_multiply/3),
%% check that there are no hook handlers added yet
?assertEqual([],get_handlers_for_all_hooks()),
?assertEqual([], get_handlers_for_all_hooks()),
%% add various hook handlers
?assertEqual(ok, gen_hook:add_handler(calculate, ?HOOK_TAG1, MultiplyHandlerFn,
#{id => 2}, 2)),
Expand Down

0 comments on commit 2ec4c5d

Please sign in to comment.