From: André Walker Date: Sat, 30 Jul 2011 03:15:36 +0000 (-0300) Subject: updated test to look for exception, not warning X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d51e94ecc0a3b5533aa47d609c5c0919a1474ab5 updated test to look for exception, not warning --- diff --git a/t/deprecated_appclass_action_warnings.t b/t/deprecated_appclass_action_warnings.t index f25d8d5..d809349 100644 --- a/t/deprecated_appclass_action_warnings.t +++ b/t/deprecated_appclass_action_warnings.t @@ -5,14 +5,9 @@ use FindBin; use lib "$FindBin::Bin/lib"; use Test::More; -use Catalyst::Test 'DeprecatedActionsInAppClassTestApp'; -plan tests => 3; +eval 'use DeprecatedActionsInAppClassTestApp'; +ok( $@, 'application dies if it has actions'); +like( $@, qr/cannot be controllers anymore/, 'for the correct reason' ); -my $warnings; -my $logger = DeprecatedActionsInAppClassTestApp::Log->new; -Catalyst->log($logger); - -ok( my $response = request('http://localhost/foo'), 'Request' ); -ok( $response->is_success, 'Response Successful 2xx' ); -is( $DeprecatedActionsInAppClassTestApp::Log::warnings, 1, 'Get the appclass action warning' ); \ No newline at end of file +done_testing; diff --git a/t/lib/DeprecatedActionsInAppClassTestApp.pm b/t/lib/DeprecatedActionsInAppClassTestApp.pm index 9c870b0..bdf4b98 100644 --- a/t/lib/DeprecatedActionsInAppClassTestApp.pm +++ b/t/lib/DeprecatedActionsInAppClassTestApp.pm @@ -4,10 +4,6 @@ use strict; use warnings; use Catalyst; -our $VERSION = '0.01'; - -__PACKAGE__->config( name => 'DeprecatedActionsInAppClassTestApp', root => '/some/dir' ); -__PACKAGE__->log(DeprecatedActionsInAppClassTestApp::Log->new); __PACKAGE__->setup; sub foo : Local { @@ -15,16 +11,4 @@ sub foo : Local { $c->res->body('OK'); } -package DeprecatedActionsInAppClassTestApp::Log; -use strict; -use warnings; -use base qw/Catalyst::Log/; - -our $warnings; - -sub warn { - my ($self, $warning) = @_; - $warnings++ if $warning =~ /action methods .+ found defined/i; -} - 1;