Skip to content

Commit

Permalink
Rename private function as per @eproxus suggestion
Browse files Browse the repository at this point in the history
This commit includes:
 * Renaming of private function name from has_been_called to has_call
with same arguments. This is in reference to the GitHub pull request
(#23) commit comment by @eproxus.
  • Loading branch information
mbbx6spp committed Mar 29, 2011
1 parent 27accbf commit 735856b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/meck.erl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ unload(Mods) when is_list(Mods) -> [unload(Mod) || Mod <- Mods], ok.
%% this function returns true, otherwise false.
-spec called(Mod::atom(), Fun::atom(), Args::list()) -> boolean().
called(Mod, Fun, Args) ->
has_been_called({Mod, Fun, Args}, meck:history(Mod)).
has_call({Mod, Fun, Args}, meck:history(Mod)).

%%==============================================================================
%% Callback functions
Expand Down Expand Up @@ -339,13 +339,13 @@ unload_if_mocked(P, L) when length(P) > 5 ->
unload_if_mocked(_P, L) ->
L.

has_been_called({_M, _F, _A}, []) -> false;
has_been_called({M, F, A}, [{{M, F, A}, _Result} | _Rest]) ->
has_call({_M, _F, _A}, []) -> false;
has_call({M, F, A}, [{{M, F, A}, _Result} | _Rest]) ->
true;
has_been_called({M, F, A}, [{{M, F, A}, _ExType, _Exception, _Stack} | _Rest]) ->
has_call({M, F, A}, [{{M, F, A}, _ExType, _Exception, _Stack} | _Rest]) ->
true;
has_been_called({M, F, A}, [_Call | Rest]) ->
has_been_called({M, F, A}, Rest).
has_call({M, F, A}, [_Call | Rest]) ->
has_call({M, F, A}, Rest).

%% --- Mock handling -----------------------------------------------------------

Expand Down

0 comments on commit 735856b

Please sign in to comment.