-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add have_sent(number).emails
matcher
#1
Comments
I think it would be a good idea to have an interface similar to Rspec Mocks. They are like this: expect(...).to receive(...).once
expect(...).to receive(...).twice
expect(...).to receive(...).exactly(n).times
expect(...).to receive(...).at_least(:once)
expect(...).to receive(...).at_least(:twice)
expect(...).to receive(...).at_least(n).times
expect(...).to receive(...).at_most(:once)
expect(...).to receive(...).at_most(:twice)
expect(...).to receive(...).at_most(n).times Maybe something that looks like: expect {...}.to have_sent(n).email
expect {...}.to have_sent.exactly(n).emails
expect {...}.to have_sent.at_least(:one).email
expect {...}.to have_sent.at_least(:two).emails
expect {...}.to have_sent.at_least(n).emails
expect {...}.to have_sent.at_most(:one).email
expect {...}.to have_sent.at_most(:two).emails
expect {...}.to have_sent.at_most(n).emails |
Great suggestion, @sophiedeziel! I'll take a look at implementing one or two of those examples over the weekend. If you're interested in contributing too, please do! PRs are always welcome. 🎉 |
Yes, I'd love to open a pull request for that! I wanted to discuss that interface with you first. I'll see if I have time to implement something today or tomorrow. |
Awesome! Looking forward to discussing it further with you. |
Add a matcher to check how many emails that have been sent as a result of an action.
The text was updated successfully, but these errors were encountered: