-
Notifications
You must be signed in to change notification settings - Fork 341
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
HTTPoison.Base behaviour #330
Conversation
It looks like it does not work with behaviours to mix def and defp and results in warnings like: warning: function process_request_headers/1 required by behaviour HTTPoison.Base was implemented as "defp" but should have been "def" (in module HTTPoisonBaseTest.ExampleDefp) test/httpoison_base_test.exs:16
@@ -50,20 +39,6 @@ defmodule HTTPoisonBaseTest do | |||
assert validate :hackney | |||
end | |||
|
|||
test "request body using ExampleDefp" do |
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.
It looks like it does not work with behaviours to mix def and defp
and results in warnings like:
warning: function process_request_headers/1 required by behaviour HTTPoison.Base was implemented as "defp" but should have been "def" (in module HTTPoisonBaseTest.ExampleDefp)
test/httpoison_base_test.exs:16
I am all for making |
Yeah I think we can push this forward and make them public. I will play with it this week and we can release a new version soon. Thanks, @JosephMichaelWebb & @whatyouhide |
Ok we can release this as a minor version as it's just a warning. I think it's ok to no bump a major version for this. I will release this soon ! Thanks 👍 |
This PR does not change the public API at all but will reorganize the primary Mojito base module functions into a Mojito.Base module meants to be pulled in via `use`. This PR also includes behaviour and callbacks for all Mojito functions for the purpose of compatibility with Mox. The implementation was borrowed from HTTPoison: edgurgel/httpoison#330 Some additional types were added for readability.
This PR does not change the public API at all but will reorganize the primary Mojito base module functions into a Mojito.Base module meants to be pulled in via `use`. This PR also includes behaviour and callbacks for all Mojito functions for the purpose of compatibility with Mox. The implementation was borrowed from HTTPoison: edgurgel/httpoison#330 Some additional types were added for readability.
This makes HTTPoison.Base a behaviour module.
This has the following benefits:
@impl
This will cause warnings if the callback module using HTTPoison.Base overrides functions that are public with private ones.