X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FTest.pm;h=3ff6b4300717a5e01ca7f76d9c9ab58f2f10a49f;hb=6e6df63d54966a0d06a850193dd30d16a2df4bef;hp=012c399c1f989a8a08a796ca916b139f14bdc036;hpb=87cbe5e65ed4394e7af6435e02031e6b1ed88592;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index 012c399..3ff6b43 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -4,21 +4,9 @@ use Test::More; use Catalyst::Exception; use Catalyst::Utils; -use Class::Inspector; +use Class::MOP; use Sub::Exporter; -{ - my $import = Sub::Exporter::build_exporter({ - groups => [ all => \&build_exports ], - into_level => 1, - }); - - sub import { - my ($self, $class) = @_; - $import->($self, '-all' => { class => $class }); - } -} - sub build_exports { my ($self, $meth, $args, $defaults) = @_; @@ -30,8 +18,8 @@ sub build_exports { } elsif (! $class) { $request = sub { Catalyst::Exception->throw("Must specify a test app: use Catalyst::Test 'TestApp'") }; } else { - unless( Class::Inspector->loaded( $class ) ) { - require Class::Inspector->filename( $class ); + unless (Class::MOP::is_class_loaded($class)) { + Class::MOP::load_class($class); } $class->import; @@ -67,6 +55,20 @@ sub build_exports { }; } +use namespace::clean; + +{ + my $import = Sub::Exporter::build_exporter({ + groups => [ all => \&build_exports ], + into_level => 1, + }); + + sub import { + my ($self, $class) = @_; + $import->($self, '-all' => { class => $class }); + } +} + =head1 NAME Catalyst::Test - Test Catalyst Applications