-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplify tests and check against new-ets branch #27
Conversation
lib/hammer_plug.ex
Outdated
@@ -210,7 +214,8 @@ defmodule Hammer.Plug do | |||
{:deny, _n} -> | |||
on_deny_handler.(conn, []) | |||
|
|||
{:error, _reason} -> | |||
{:error, reason} -> | |||
Logger.error(check_rate_fail_reason: reason) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should raise an exception, I think. Plug would catch it, send 500, and then re-raise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Hammer as well, I think {:error, reason}` return value can be removed in favor of an exception since it's unclear what should be done in that case, allow or deny.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: #35
mix.exs
Outdated
{:hammer, "~> 6.0"}, | ||
{:plug, "~> 1.0"}, | ||
{:mock, "~> 0.3.0", only: :test} | ||
{:hammer, github: "ruslandoga/hammer", branch: "new-ets"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be changed to ~> 7.0
once ExHammer/hammer#104 is merged.
@@ -1 +1,2 @@ | |||
{:ok, _apps} = Application.ensure_all_started([:plug]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:plug
doesn't need to be started since the tests are not using Plug.Upload
This PR checks that the tests pass with changes in ExHammer/hammer#104
To actually make the tests check integration with Hammer I removed Mock.