Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added tests/docs for Mail::Box::Manager usage
- subclassed type() method to return 'imaps' git-svn-id: https://dagolden.googlecode.com/svn/Mail-Box-IMAP4-SSL/trunk@1528 dfce27d5-b31c-0410-bb09-030b4413eeba
- Loading branch information
Showing
8 changed files
with
123 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,4 @@ | |||
TODO list for Perl module Mail::Box::IMAP4::SSL | TODO list for Perl module Mail::Box::IMAP4::SSL | ||
|
|
||
- Define our type different than IMAP4. When opened via a Mail::Box::Manager, | - add some todos | ||
be sure to register our type with the manager. | |||
|
|||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,59 @@ | |||
package main; | |||
use strict; | |||
use warnings; | |||
|
|||
#--------------------------------------------------------------------------# | |||
# requirements, fixtures and plan | |||
#--------------------------------------------------------------------------# | |||
|
|||
use Test::More; | |||
use Proc::Background; | |||
use File::Spec; | |||
use IO::CaptureOutput qw/capture/; | |||
use Mail::Box::Manager; | |||
use Probe::Perl; | |||
|
|||
|
|||
# expected credentials for server and client | |||
my $username = 'johndoe'; | |||
my $password = '123456'; | |||
my $port = '31415'; | |||
|
|||
# fire up the local mock server or skip tests | |||
my $imapd = Proc::Background->new( | |||
{ die_upon_destroy => 1 }, | |||
Probe::Perl->find_perl_interpreter(), | |||
File::Spec->rel2abs(File::Spec->catfile(qw/t bin imapd.pl/)), | |||
$port, | |||
$username, | |||
$password, | |||
); | |||
|
|||
sleep 2; # give time for imapd to fire up and listen | |||
|
|||
unless ( $imapd && $imapd->alive ) { | |||
plan skip_all => "Couldn't launch mock imapd on localhost" | |||
} | |||
|
|||
plan tests => 3 ; | |||
|
|||
my ($stdout, $stderr, $rc); | |||
|
|||
#--------------------------------------------------------------------------# | |||
# tests begin here | |||
#--------------------------------------------------------------------------# | |||
|
|||
ok( $imapd->alive, "mock imapd server is alive" ); | |||
|
|||
my $mbm = Mail::Box::Manager->new; | |||
|
|||
$mbm->registerType( 'imaps', 'Mail::Box::IMAP4::SSL' ); | |||
|
|||
my $imap = $mbm->open( | |||
folder => "imaps://$username\:$password\@127.0.0.1:$port/" | |||
); | |||
|
|||
ok( $imap, "connected to mock imapd" ); | |||
is( $imap->type, 'imaps', "imaps folder has correct type" ); | |||
|
|||
|