[rspec-users] The RSpec way of doing this? Need help on validating block
pergesu at gmail.com
Thu Dec 4 12:52:35 EST 2008
Glad I could help!
"Sebastian W." <lists at ruby-forum.com> writes:
> Ha! Don't I feel silly. Just figured it out, I think.
> Sebastian W. wrote:
>> Yikes, left out the all-important call:
>>> 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
> mock_smtp = mock("smtp")
> mock_smtp.should_recieve(:send_message).with("Yay! You got an
> email!", 'your at mail',
> 'other at mail')
> Mission accomplished. :P
More information about the rspec-users