[Catalyst] script/create test file uri

Carl Franks fireartist at gmail.com
Fri Mar 3 12:01:08 CET 2006


I'd like to submit a patch to change the contents of generated
test-files, such that instead of testing:
    ok( request('action')->is_success, 'Request should succeed' );
it tests:
    ok( request('/action')->is_success, 'Request should succeed' );

(note the leading "/" in the uri)

There are 2 ways to do this, either change the __comptest__ template
in Helper.pm from:
    request('[% uri %]')
to:
    request('/[% uri %]')

Or prepend the "/" to the $self->{uri} variable in the next_test() method.

I think the 2nd option is the 'better' fix, but I'm not sure of the
consequences.
Certainly, in Helper.pm, the only place the value of $self->{uri} is
used, is in the __comptest__ template.
However, I've no idea whether the value might be used by other helper
packages outside the main catalyst distro.
Depending on how other files use it, it might be a good thing that
it's 'fixed', then again, maybe not!

Guidance, please?

Cheers,
Carl



More information about the Catalyst mailing list