X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_component_mro.t;h=a8699c30e22ffcdb961c6e95294c6438c326667c;hb=79f5d5718d885ee1c3f288159a31562f9cf5b02f;hp=78184028383dec44e19e75b47d5a35ddf1b24779;hpb=6a7254b57957f4f40cee98226a93b012c5427cfe;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_component_mro.t b/t/unit_core_component_mro.t index 7818402..a8699c3 100644 --- a/t/unit_core_component_mro.t +++ b/t/unit_core_component_mro.t @@ -1,4 +1,4 @@ -use Test::More tests => 2; +use Test::More tests => 1; use strict; use warnings; @@ -6,9 +6,8 @@ use warnings; package MyApp::Component; use Test::More; - sub COMPONENT{ - my $caller = caller; - is($caller, 'Catalyst::Component', 'Correct method resolution'); + sub COMPONENT { + fail 'This no longer gets dispatched to'; } package MyApp::MyComponent; @@ -17,10 +16,14 @@ use warnings; } -{ - my $expects = qr/after Catalyst::Component in MyApp::Component/; +my $warn = ''; +{ local $SIG{__WARN__} = sub { - like($_[0], $expects, 'correct warning thrown'); + $warn .= $_[0]; }; MyApp::MyComponent->COMPONENT('MyApp'); } + +like($warn, qr/after Catalyst::Component in MyApp::Component/, + 'correct warning thrown'); +