F
Fernando Guillen
Hi people,
I have an application that download emails from an email account an
process them.
What I would like to do is to mock the mail download petition and not
process the real mails but an array of mails I have for this propos.
This is the precise situation: I have this:
I would like to have a mock that if on my test call to
=> Net:OP3.start( opts[:server], port, opts[:user], opts[ass] ) do
|pop|
Not any mailing petition is done but the body of the method is still
working but not with real mails but with an array of fake mails like
this:
=> mails = [ File.read('/dir/mail1.raw_mail'),
File.read('/dir/mail2.raw_mail')]
Is this possible?.. am I completely lost?.. is there any better way to
do this?
Any suggestion is welcome.
Thanks
f.
I have an application that download emails from an email account an
process them.
What I would like to do is to mock the mail download petition and not
process the real mails but an array of mails I have for this propos.
This is the precise situation: I have this:
Code:
Net::POP3.start( opts[:server], port, opts[:user], opts[:pass] )
do |pop|
pop.each_mail do |m|
block.call( m )
end
end
I would like to have a mock that if on my test call to
=> Net:OP3.start( opts[:server], port, opts[:user], opts[ass] ) do
|pop|
Not any mailing petition is done but the body of the method is still
working but not with real mails but with an array of fake mails like
this:
=> mails = [ File.read('/dir/mail1.raw_mail'),
File.read('/dir/mail2.raw_mail')]
Is this possible?.. am I completely lost?.. is there any better way to
do this?
Any suggestion is welcome.
Thanks
f.