You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a small app just to play with Rust a little bit.
I stumbled upon mockall which looks very familiar to me having experience in Node and Python but I can't figure out how to mock correctly the dependencies (lettre) to my SmtpMailService.
My goal is to provide a fake AsyncSmtpTransport and test whether send_email returns Ok or Err based on the conditions in the test.
The compiler shows an error in the test, I understand why it happens but don't know how to fix it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm writing a small app just to play with Rust a little bit.
I stumbled upon mockall which looks very familiar to me having experience in Node and Python but I can't figure out how to mock correctly the dependencies (lettre) to my
SmtpMailService
.My goal is to provide a fake
AsyncSmtpTransport
and test whethersend_email
returnsOk
orErr
based on the conditions in the test.The compiler shows an error in the test, I understand why it happens but don't know how to fix it.
Beta Was this translation helpful? Give feedback.
All reactions