[prev] [thread] [next] [lurker] [Date index for 2002/09/10]
Update of /cvsroot/siesta/siesta/t In directory usw-pr-cvs1:/tmp/cvs-serv21254/t Modified Files: 10plugin_replyto.t 10plugin_simplesig.t Log Message: Fix the tests. Basically they were caused by the mock objects not having user methods defined and the list object doesn't have an id method defined. Plus the db wasn't connected. Index: 10plugin_replyto.t =================================================================== RCS file: /cvsroot/siesta/siesta/t/10plugin_replyto.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- 10plugin_replyto.t 28 Aug 2002 09:26:36 -0000 1.2 +++ 10plugin_replyto.t 10 Sep 2002 09:20:34 -0000 1.3 @@ -1,15 +1,23 @@ #!perl -w use strict; +use Siesta; use Test::More tests => 5; use Test::MockObject; +Siesta->connect( DBI => 'dbi:SQLite:t/test.db' ); use Siesta::Message; use Siesta::Plugin::ReplyTo; my $plugin = Siesta::Plugin::ReplyTo->new; my $POST_ADDRESS = 'foo@xxx.xxx'; -my $mail = Siesta::Message->new; -$mail->list( Test::MockObject->new->mock( post_address => sub { $POST_ADDRESS } ) ); +my $mail = Siesta::Message->new(); +my $list = Test::MockObject->new(); +$list->mock( post_address => sub { $POST_ADDRESS } ) ; +$list->mock( id => sub { 'test' } ); + +$mail->list( $list ); +$mail->user( undef ); + is ($mail->head->get("Reply-To"), undef, "blank"); ok( !$plugin->process( $mail ) ); Index: 10plugin_simplesig.t =================================================================== RCS file: /cvsroot/siesta/siesta/t/10plugin_simplesig.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- 10plugin_simplesig.t 23 Aug 2002 14:26:38 -0000 1.4 +++ 10plugin_simplesig.t 10 Sep 2002 09:20:34 -0000 1.5 @@ -3,6 +3,10 @@ use strict; use Test::More tests => 2; +use Siesta; + +Siesta->connect( DBI => 'dbi:SQLite:t/test.db' ); + my @mail = map { "$_\n" } split /\n/, <<END; Clerks, 1994. http://us.imdb.com/Quotes?0109445 @@ -23,11 +27,16 @@ my $reply; my $list = Test::MockObject->new - ->mock( owner => sub { "Daddy" } ); + ->mock( owner => sub { "Daddy" } ) + ->mock( id => sub { 'test' } ); + + my $mail = Test::MockObject->new ->mock( body => sub { [ @mail ] } ) ->mock( reply => sub { $reply = join '', @_ } ) - ->mock( list => sub { $list } ); + ->mock( list => sub { $list } ) + ->mock( user => sub { undef } ); + my $plugin = new Siesta::Plugin::SimpleSig;
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52