X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_component_loading.t;h=c8098c6f9cb2c86fa655bbe17e3d6761ef1564e0;hb=0f52a840d0cc3c88cf1367c6dae6c1eb492ea0fa;hp=bae3c5e6d1ade154983d23d9bbf3bbeb78ed2738;hpb=7fa2c9c1b85c98786655ad5169708d8dc84e8353;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_component_loading.t b/t/unit_core_component_loading.t index bae3c5e..c8098c6 100644 --- a/t/unit_core_component_loading.t +++ b/t/unit_core_component_loading.t @@ -40,7 +40,7 @@ my @components = ( { type => 'View', prefix => 'View', name => 'Foo' }, ); -sub write_component_file { +sub write_component_file { my ($dir_list, $module_name, $content) = @_; my $dir = File::Spec->catdir(@$dir_list); @@ -63,10 +63,10 @@ sub make_component_file { write_component_file(\@dir_list, $name_final, <NEXT::COMPONENT(\@_); + my \$self = shift->next::method(\@_); no strict 'refs'; *{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; }; \$self; @@ -82,7 +82,11 @@ foreach my $component (@components) { $component->{name}); } -eval "package $appclass; use Catalyst; __PACKAGE__->setup"; +my $shut_up_deprecated_warnings = q{ + __PACKAGE__->log(Catalyst::Log->new('fatal')); +}; + +eval "package $appclass; use Catalyst; $shut_up_deprecated_warnings __PACKAGE__->setup"; can_ok( $appclass, 'components'); @@ -141,6 +145,7 @@ foreach my $component (@components) { eval qq( package $appclass; use Catalyst; +$shut_up_deprecated_warnings __PACKAGE__->config->{ setup_components } = { search_extra => [ '::Extra' ], except => [ "${appclass}::Controller::Foo" ] @@ -165,8 +170,8 @@ write_component_file([$libdir, $appclass, 'Model'], 'TopLevel', <NEXT::COMPONENT(\@_); + + my \$self = shift->next::method(\@_); no strict 'refs'; *{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; }; \$self; @@ -185,7 +190,7 @@ package ${appclass}::Model::TopLevel::Nested; use base 'Catalyst::Model'; no warnings 'redefine'; -sub COMPONENT { return shift->NEXT::COMPONENT(\@_); } +sub COMPONENT { return shift->next::method(\@_); } 1; EOF