5 use Test::More tests => 4;
8 BEGIN { # Do this at compile time in case we generate a warning when use
10 $SIG{__WARN__} = sub {
11 $warnings++ if $_[0] =~ /uses NEXT, which is deprecated/;
12 $warnings++ if $_[0] =~ /trying to use NEXT, which is deprecated/;
15 use Catalyst; # Cause catalyst to be used so I can fiddle with the logging.
18 my $logger = Class::MOP::Class->create_anon_class(
23 if ($_[1] =~ /switch your class names/) {
27 die "Caught unexpected warning: " . $_[1];
31 Catalyst->log($logger);
34 use Catalyst::Test 'DeprecatedTestApp';
35 is( $mvc_warnings, 1, 'Get the ::MVC:: warning' );
37 ok( my $response = request('http://localhost/'), 'Request' );
38 is( $response->header('X-Catalyst-Plugin-Deprecated'), '1', 'NEXT plugin ran correctly' );
40 is( $warnings, 1, 'Got one and only one Adopt::NEXT warning');