7 use Test::More tests => 4;
11 BEGIN { # Do this at compile time in case we generate a warning when use
13 $SIG{__WARN__} = sub { $warnings++ if $_[0] =~ /trying to use NEXT/ };
15 use Catalyst; # Cause catalyst to be used so I can fiddle with the logging.
18 my $logger = Test::MockObject->new;
19 $logger->mock('warn', sub { $mvc_warnings++ if $_[1] =~ /switch your class names/ });
20 Catalyst->log($logger);
23 use Catalyst::Test 'DeprecatedTestApp';
24 is( $mvc_warnings, 1, 'Get the ::MVC:: warning' );
26 ok( my $response = request('http://localhost/'), 'Request' );
27 is( $response->header('X-Catalyst-Plugin-Deprecated'), '1', 'NEXT plugin ran correctly' );
30 skip 'non-dev release', 1 unless Catalyst::_IS_DEVELOPMENT_VERSION();
31 is( $warnings, 1, 'Got one and only one Adopt::NEXT warning');