[Catalyst] script/create.pl -mech controller (patch)

Matt S Trout dbix-class at trout.me.uk
Fri Mar 3 13:37:56 CET 2006


On Fri, Mar 03, 2006 at 01:25:25PM +0100, Sebastian Riedel wrote:
> 
> 03.03.2006 11:51 Carl Franks:
> 
> > Attached is a patch which adds a new '-mech' flag to the
> > script/create.pl program
> >
> > It changes the generated test-file, so that instead of testing this...
> > ***
> > BEGIN { use_ok 'Catalyst::Test', 'myapp' }
> > BEGIN { use_ok 'testfoo::Controller::Login' }
> >
> > ok( request('login')->is_success, 'Request should succeed' );
> > ***
> >
> > It instead tests...
> > ***
> > BEGIN { use_ok 'Test::WWW::Mechanize::Catalyst', 'myapp' }
> >
> > ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'created mech  
> > object' );
> > $mech->get_ok( 'http://localhost/login' );
> > ***
> >
> > The flag does nothing when creating something other than a controller.
> >
> > The patch is for file "trunk/Catalyst/lib/Catalyst/Helper.pm"
> > against svn revision 3535
> 
> We can't do that, as much as i like Test::WWW::Mechanize, it's not a  
> core prereq, so we can't use it in generated code.

Erm, so? Have it check for Test::WWW::Mechanize::Catalyst if the -mech flag
is passed and bomb out if not, plus emit a warning saying "make sure this
is in your Makefile.PL".

Seem reasonable?

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list