search for: mocksmtp

Displaying 1 result from an estimated 1 matches for "mocksmtp".

2008 Dec 04
3
The RSpec way of doing this? Need help on validating block
...ge("Yay! You got an email!", ''your at mail'', ''other at mail'') end def def mailer Net::SMTP end end describe EmailSender do it "Should use Net::SMTP to send email" es = EmailSender.new es.mailer.should == Net::SMTP MockSMTP = mock("Net::SMTP") def es.mailer MockSMTP end MockSMTP.should_receive(:start).with(''your.smtp.server'', 25) #but, er...wha? end end So - not sure how to validate the part where "send_message" is called. Is there a recommended way of doi...