[siesta-commit] siesta/t 15defer.t,NONE,1.1

[prev] [thread] [next] [lurker] [Date index for 2003/03/16]

From: clampr
Subject: [siesta-commit] siesta/t 15defer.t,NONE,1.1
Date: 00:47 on 16 Mar 2003
Update of /cvsroot/siesta/siesta/t
In directory sc8-pr-cvs1:/tmp/cvs-serv5250/t

Added Files:
	15defer.t 
Log Message:
start of a deferred framework

--- NEW FILE: 15defer.t ---
#!perl -w
use strict;
use Test::More tests => 5;
use Siesta;
use Siesta::Config;

unlink map { <t/root/queue/dealers/$_/*> } qw( tmp new cur );

Siesta->connect( DBI => "dbi:SQLite:t/test.db" );
$Siesta::Config::ROOT = 't/root';

my $list = Siesta::List->new('dealers');
ok( $list, "got a list" );

my $message = Siesta::Message->new(\*DATA);
ok( $message, "made a message" );

is( $message->subject, "yoohoo\n" );
$message->list($list);

my @deferred = $list->deferred;
is( scalar @deferred, 0, "we have no deferred messages" );

$message->defer( deferred_for => '' );

@deferred = $list->deferred;
is( scalar @deferred, 1, "we have 1 deferred message" );

is( $deferred[0]->subject, "yoohoo\n", "deferred message has correct subject" );

__DATA__
To: dealers@xxxxxxxx.xxxxxxxxxx
Subject: yoohoo

All you motherfuckers are gonna pay, You are the ones who are the
ball-lickers.  We're gonna fuck your mothers while you watch and cry
like little bitches.  Once we get to Hollywood and find those Miramax
fucks who are making that movie, we're gonna make 'em eat our shit,
then shit out our shit, then eat their shit which is made up of our
shit that we made 'em eat.  Then you're all fucking next.

Love, Jay and Silent Bob.



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