beam-community / bamboo

Testable, composable, and adapter based Elixir email library for devs that love piping.
https://hex.pm/packages/bamboo
MIT License
1.91k stars 345 forks source link

Use refute_timeout configured for all refute_ assertions #603

Closed germsvel closed 3 years ago

germsvel commented 3 years ago

What changed?

All refutation test helpers in Bamboo.Test should be using the refute_timeout configuration when testing on shared mode.

config :bamboo, :refute_timeout, 10

The refute_email_delivered_with/1 macro was not using the configuration, but instead it had a hardcoded 100ms. We update it to use the refute_timeout, since not using it was a bug.

Finally, the refute_timeout/0 function currently returns 0ms when Bamboo isn't on shared mode. We change that to be 100ms to match the previously hardcoded value in refute_email_delivered_with/1 and to match the default refute_receive_timeout from ExUnit.