Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname(__FILE__) + '/base'
- describe Pony do
- describe "transport" do
- it "transports mail via Net::SMTP using specified server" do
- o = {:smtp => {:host => 'localhost', :port => '25', :domain => 'localhost.localdomain', :user => 'user', :password => 'password', :auth => 'plain'}}
- smtp = mock('net::smtp object')
- Net::SMTP.should_receive(:new).with('localhost', '25').and_return(smtp)
- smtp.should_receive(:start).with('localhost.localdomain', 'user', 'password', 'plain')
- smtp.should_receive(:send_message).with('message', 'from', 'to')
- smtp.should_receive(:finish)
- Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'), o)
- end
- end
- end
Add Comment
Please, Sign In to add comment