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:

[code]
      Net::POP3.start( opts[:server], port, opts[:user], opts[:pass] )
do |pop|
        pop.each_mail do |m|
          block.call( m )
        end
      end
[/code]

I would like to have a mock that if on my test call to

=> Net::POP3.start( opts[:server], port, opts[:user], opts[:pass] ) 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.
-- 
Posted via http://www.ruby-forum.com/.