Turn some test helpers from macros -> functions #604
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
We change three test helpers in
Bamboo.Test
from macros into regular functions:assert_delivered_email/1
assert_delivered_email_with/1
refute_email_delivered_with/1
There are other helpers that are already functions:
assert_no_emails_delivered/0
refute_delivered_email/1
The only macro we leave as a macro (because it needs to be one) is
assert_delivered_email_matches/1
Why?
There seems no reason for those functions to be macros, and they only add extra complexity.
A side benefit
A side benefit of doing this is that we can make all the private functions truly private with
defp
. With the macros, we had to make them public (to access them from the macros), and we set@doc false
so they wouldn't show up in docs.