Guest User

Untitled

a guest
Feb 28th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/base'
  2.  
  3. describe Pony do
  4.  
  5. describe "transport" do
  6.  
  7. it "transports mail via Net::SMTP using specified server" do
  8. o = {:smtp => {:host => 'localhost', :port => '25', :domain => 'localhost.localdomain', :user => 'user', :password => 'password', :auth => 'plain'}}
  9. smtp = mock('net::smtp object')
  10. Net::SMTP.should_receive(:new).with('localhost', '25').and_return(smtp)
  11. smtp.should_receive(:start).with('localhost.localdomain', 'user', 'password', 'plain')
  12. smtp.should_receive(:send_message).with('message', 'from', 'to')
  13. smtp.should_receive(:finish)
  14. Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'), o)
  15. end
  16. end
  17.  
  18. end
Add Comment
Please, Sign In to add comment