Skip to content
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

Assertions are destructive #632

Open
kaikuchn opened this issue Dec 1, 2021 · 0 comments
Open

Assertions are destructive #632

kaikuchn opened this issue Dec 1, 2021 · 0 comments

Comments

@kaikuchn
Copy link

kaikuchn commented Dec 1, 2021

Hey there,

I just started using this mail client, and it works like a charm! Thank you all for your hard work :)
One thing that really surprised me during integration testing is that the assertions are destructive. I.e., the following code works as expected when you've sent one e-mail.

# deliver email
Mail.deliver_later()
# email was delivered, so the inner assertion raises
assert_raise(ExUnit.AssertionError, fn -> assert_no_emails_delivered() end)
# however, now there are no more delivered emails, so this does not raise
assert_no_emails_delivered()

It would be nice if this behaviour was documented. Personally I believe that problems like ordering the assertions (see
#433) would not exist if the assertions would not be destructive. But that would be a breaking change :)

Thanks again for your hard work, let me know if you want me to prepare a pull request for the docs.

Best,
Kai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant