[Catalyst] unit testing with MockObject

Daniel McBrearty danielmcbrearty at gmail.com
Sat Jun 3 18:29:48 CEST 2006


I also get this in the output :

Engoi::Controller::Public->_DISPATCH "Can't use an undefined value as
an ARRAY reference at /usr/local/share/perl/5.8.7/Catalyst/Base.pm
line 19."

which is this in Base.pm :

sub _DISPATCH : Private {
    my ( $self, $c ) = @_;
    foreach my $disp ( @{ $self->_dispatch_steps } ) { # line 19
        last unless $c->forward($disp);
    }
    $c->forward('_END');
}


 ... but i'm not going to worry about it right now ...


On 6/3/06, Daniel McBrearty <danielmcbrearty at gmail.com> wrote:
> that was it, Matt.
>
> Thanks!
>
> All we need now is Sri Lanka 50-5 at close, and I'm off for a drink.
> (but perhaps I ought not to put that condition on it ...)
>
>
> On 6/3/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> > Daniel McBrearty wrote:
> > > now I have this :
> > >
> > > BEGIN {
> > >     my $mock = Test::MockObject->new;
> > >     $mock->fake_module('Engoi::Controller::Public');
> > >     $mock->set_true('home');
> > >     use_ok('Catalyst::Test', 'Engoi');
> > >     Engoi->components->{'Controller::Public'} = $mock;
> > > }
> > >
> > > but I still have my errors as before, and the mock object is not being
> > > used by Cat.
> >
> > balls.
> >
> > Engoi->components->{'Engoi::Controller::Public'} = $mock;
> >
> > _______________________________________________
> > Catalyst mailing list
> > Catalyst at lists.rawmode.org
> > http://lists.rawmode.org/mailman/listinfo/catalyst
> >
>
>
> --
> Daniel McBrearty
> email : danielmcbrearty at gmail.com
> www.engoi.com : the multi - language vocab trainer
> BTW : 0873928131
>


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131



More information about the Catalyst mailing list