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

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

From: clampr
Subject: [siesta-commit] siesta/t 10plugin_unsubscribe.t,NONE,1.1
Date: 19:02 on 24 Aug 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv25902

Added Files:
	10plugin_unsubscribe.t 
Log Message:
carbon copy of subscribe


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

use Siesta::Plugin::UnSubscribe;

my $plugin = Siesta::Plugin::UnSubscribe->new;
my $list = Test::MockObject->new
  ->mock( id            => sub { 'escapees' } )
  ->mock( owner         => sub { 'houdini@elsewhere' } )
  ->mock( remove_member => sub { $_[1] eq 'suzanne@lab' } );

my $reply;
my $mail = Test::MockObject->new
  ->mock( list  => sub { $list } )
  ->mock( from  => sub { 'suzanne@lab' } )
  ->mock( reply => sub { $reply = join '', @_ } );

ok( $plugin->process( $mail ), "request handled" );
like( $reply, qr/You have been/, "unsubscribed suzanne" );

$mail->mock( from => sub { 'jay@jail' } );
ok( $plugin->process( $mail ) );
like( $reply, qr/You could not be/, "unsubscribing jay failed" );

1;



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