-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn some test helpers from macros -> functions (#604)
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. > Macros should only be used as a last resort - from Elixir's [getting started docs](https://elixir-lang.org/getting-started/meta/macros.html) A side benefit ------------- A side benefit of doing this is that we can make most of 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.
- Loading branch information
Showing
1 changed file
with
29 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters