This file documents the revision history for Perl extension Catalyst-Devel.
+ - Don't bother with the BEGIN { use_ok dance for created tests
+ - the test will fail to compile (and ergo fail) using just use,
+ and that's less typing (and less copy-pasting)
- Split method for creating tests into multiple methods to allow
subclasses to override the generation of some tests.
- Allow the author to be defined in the call to ->new to help things
use warnings;
use Test::More;
-BEGIN { use_ok 'Catalyst::Test', '[% name %]' }
+use Catalyst::Test '[% name %]';
ok( request('/')->is_success, 'Request should succeed' );
use strict;
use warnings;
-[% IF long_type == 'Controller' %][% IF mech %]use Test::More;
+use Test::More;
+[% IF long_type == 'Controller' %][% IF mech %]
-eval "use Test::WWW::Mechanize::Catalyst '[% name %]'";
-if ($@) {
+unless (eval q{use Test::WWW::Mechanize::Catalyst '[% name %]'; 1}) {
plan skip_all => 'Test::WWW::Mechanize::Catalyst required';
exit 0;
}
ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' );
$mech->get_ok( 'http://localhost[% uri %]' );
-[%- ELSE %]use Test::More;
+[%- ELSE %]
-BEGIN { use_ok 'Catalyst::Test', '[% app %]' }
-BEGIN { use_ok '[% class %]' }
+use Catalyst::Test '[% app %]';
+use [% class %];
ok( request('[% uri %]')->is_success, 'Request should succeed' );
[%- END -%]