Skip to content

Commit

Permalink
no need to match handle_event in detail
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Rehfeld committed Apr 24, 2012
1 parent ded21f4 commit 2ca7fe9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
24 changes: 1 addition & 23 deletions src/elli_basicauth.erl
Expand Up @@ -26,29 +26,7 @@ handle(Req, Config) ->
end. end.




handle_event(request_complete, [_Req, _ResponseCode, _ResponseHeaders, handle_event(_, _, _) ->
_ResponseBody, _Timings], _Config) ->
ok;

handle_event(request_throw, _, _Config) ->
ok;

handle_event(request_exit, _, _Config) ->
ok;

handle_event(request_error, _, _Config) ->
ok;

handle_event(request_parse_error, [_Data], _Args) ->
ok;

handle_event(client_closed, [_When], _Config) ->
ok;

handle_event(client_timeout, [_When], _Config) ->
ok;

handle_event(elli_startup, [], _Config) ->
ok. ok.




Expand Down
30 changes: 30 additions & 0 deletions test/elli_basicauth_tests.erl
Expand Up @@ -58,6 +58,36 @@ invalid_credentials_test() ->
meck:unload(elli_request). meck:unload(elli_request).




elli_handler_behaviour_test() ->
?assertEqual(ok, elli_basicauth:handle_event(request_complete,
[mock_request,
mock_response_code,
mock_response_headers,
mock_response_body,
mock_timings], mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(request_throw,
mock_dummy, mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(request_exit,
mock_dummy, mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(request_error,
mock_dummy, mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(request_parse_error,
[mock_data], mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(client_closed,
[mock_when], mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(client_timeout,
[mock_when], mock_config)),

?assertEqual(ok, elli_basicauth:handle_event(elli_startup,
[], mock_config)).


%% %%
%% HELPERS %% HELPERS
%% %%
Expand Down

0 comments on commit 2ca7fe9

Please sign in to comment.