I'm not completely following the action class thing, but the way that
seems most logical to me is to write a plugin C::P::EmailTestable that
subclasses C::P::Email
sub email {
if (my $location = $c-config-{test_email}) {
# write a temporary file into $location, and put the filename on the
Daniel McBrearty wrote:
... but I'm thinking, how can one plugin inherit from another? $self
isn't passed ...
Your plugin ISA Catalyst, so instead of $self, you get a $c.
Subclassing should work. $c-next::method(@_) or whatever;
--
package JAPH;use Catalyst
OK. That does work if I use :
$c-SUPER::email($c, @_);
to call the superclass.
Interestingly, if I use SUPER.pm ... :
package Catalyst::Plugin::EmailTestable;
use strict;
use warnings;
use base qw ( Catalyst::Plugin::Email );
use SUPER;
sub email {
my $c = shift;
my $super =
Daniel McBrearty wrote:
OK. That does work if I use :
$c-SUPER::email($c, @_);
Don't use SUPER. Don't pass $c twice.
Use NEXT::email(@_) (from NEXT) or next::method(@_) (from Class::C3),
since SUPER and Catalyst don't get along.
Regards,
Jonathan Rockway
# terse because I haven't slept for
that's a nice idea. thanks Perrin.
On 12/18/06, Perrin Harkins [EMAIL PROTECTED] wrote:
Daniel McBrearty wrote:
if you have an action that sends an email, how do you write tests for it?
We do it by subclassing Net::SMTP::Server to write all mail to files in
a temp directory. Then we send the
you just want to see the text that you are generating the for the
email, make some kind of sanity check on it, just before it hits the
email module. I'll check it out.
On 12/16/06, Ash Berlin [EMAIL PROTECTED] wrote:
Daniel McBrearty wrote:
if you have an action that sends an email, how do you
if you have an action that sends an email, how do you write tests for it?
perhaps print the email to a temp file in test mode? what do you guys do?
--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131