[siesta-commit] siesta/t 10plugin_subjecttag.t,NONE,1.1

[prev] [thread] [next] [lurker] [Date index for 2002/08/23]

From: clampr
Subject: [siesta-commit] siesta/t 10plugin_subjecttag.t,NONE,1.1
Date: 16:20 on 23 Aug 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv28923/t

Added Files:
	10plugin_subjecttag.t 
Log Message:
simplify subjecttag by adding a convenience method to Message + tests for subjecttag

--- NEW FILE: 10plugin_subjecttag.t ---
#!perl -w
use strict;
use Test::More tests => 7;
use Test::MockObject;

use Siesta::Message;
use Siesta::Plugin::SubjectTag;
my $plugin = Siesta::Plugin::SubjectTag->new;

my $mail = Siesta::Message->new;
$mail->list( Test::MockObject->new->mock( id => sub { 'cockknocker' } ) );

$mail->subject("Mark Hamill\n");
is( $mail->subject, "Mark Hamill\n", "before" );
ok( !$plugin->process( $mail ) );
is( $mail->subject, "[cockknocker] Mark Hamill\n", "added tag after" );

ok( !$plugin->process( $mail ) );
is( $mail->subject, "[cockknocker] Mark Hamill\n", "added tag once" );

$mail->subject( "Re: [cockknocker] Mark Hamill\n" );
ok( !$plugin->process( $mail ) );
is( $mail->subject, "Re: [cockknocker] Mark Hamill\n", "okay with Re: lines" );



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52