[siesta-commit] siesta/t 03message.t,NONE,1.1

[prev] [thread] [next] [lurker] [Date index for 2002/10/10]

From: clampr
Subject: [siesta-commit] siesta/t 03message.t,NONE,1.1
Date: 10:56 on 10 Oct 2002
Update of /cvsroot/siesta/siesta/t
In directory usw-pr-cvs1:/tmp/cvs-serv14744/t

Added Files:
	03message.t 
Log Message:
move to Mail::Address

--- NEW FILE: 03message.t ---
#!perl -w
use strict;
use Test::More tests => 6;
use Test::MockObject;
use Siesta::Message;

my $msg = Siesta::Message->new( \*DATA );
isa_ok( $msg, 'Siesta::Message' );
is( ( $msg->to )[0], 'dealers', "->to" );
is( ( $msg->from )[0], 'Jay@front_of.quick_stop', "->from" );

my $sent;
my $mock = Test::MockObject->new;
$mock->fake_module(
    'Siesta::Send::Fake',
    new => sub {
        Test::MockObject->new->mock( send => sub { $sent = $_[1] } );
    }
    );

Siesta->set_sender('Fake');

$msg->reply( body => 'foo' );
is( ( $sent->from )[0], 'dealers', "reply" );
is( ( $sent->to )[0], 'Jay@front_of.quick_stop' );
is_deeply( $sent->body, ["foo\n"] );

__DATA__
From: Jay <Jay@front_of.quick_stop>
To: <dealers>



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