X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdeprecated.t;h=cfb5adf845c8674a6e8bc7b3e1aef37a03d194aa;hb=6a163489e06d0e5035aa3f1a155e8c9d82b3ffd2;hp=f1990823e45f811302f6771cb07d448c2ee96f8b;hpb=19a24dbb5b7329841b77ce80102c85c6bb137dee;p=catagits%2FCatalyst-Runtime.git diff --git a/t/deprecated.t b/t/deprecated.t index f199082..cfb5adf 100644 --- a/t/deprecated.t +++ b/t/deprecated.t @@ -5,7 +5,6 @@ use warnings; use FindBin qw/$Bin/; use lib "$Bin/lib"; use Test::More tests => 4; -use Test::MockObject; my $warnings; BEGIN { # Do this at compile time in case we generate a warning when use @@ -15,8 +14,17 @@ BEGIN { # Do this at compile time in case we generate a warning when use use Catalyst; # Cause catalyst to be used so I can fiddle with the logging. my $mvc_warnings; BEGIN { - my $logger = Test::MockObject->new; - $logger->mock('warn', sub { $mvc_warnings++ if $_[1] =~ /switch your class names/ }); + my $logger = Class::MOP::Class->create_anon_class( + methods => { + warn => sub { + if ($_[1] =~ /switch your class names/) { + $mvc_warnings++; + return; + } + die "Caught unexpected warning: " . $_[1]; + }, + }, +)->new_object; Catalyst->log($logger); } @@ -26,4 +34,7 @@ is( $mvc_warnings, 1, 'Get the ::MVC:: warning' ); ok( my $response = request('http://localhost/'), 'Request' ); is( $response->header('X-Catalyst-Plugin-Deprecated'), '1', 'NEXT plugin ran correctly' ); -is( $warnings, 1, 'Got one and only one Adopt::NEXT warning'); +SKIP: { + skip 'non-dev release', 1 unless Catalyst::_IS_DEVELOPMENT_VERSION(); + is( $warnings, 1, 'Got one and only one Adopt::NEXT warning'); +}