make this test lib like all the others
John Napiorkowski [Tue, 14 Apr 2015 19:56:42 +0000 (14:56 -0500)]
t/inject_component_util.t
t/lib/Test/Apple.pm [new file with mode: 0644]

index c757d9c..7162202 100644 (file)
@@ -2,7 +2,9 @@ use strict;
 use warnings; 
 use Test::More;
 use Catalyst::Utils;
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
 BEGIN {
 package Model::Banana;
  
@@ -20,9 +22,9 @@ use Catalyst;
 after 'setup_components' => sub {
     my $self = shift;
     Catalyst::Utils::inject_component( into => __PACKAGE__, component => 'Model::Banana' );
-    Catalyst::Utils::inject_component( into => __PACKAGE__, component => 't::Test::Apple' );
+    Catalyst::Utils::inject_component( into => __PACKAGE__, component => 'Test::Apple' );
     Catalyst::Utils::inject_component( into => __PACKAGE__, component => 'Model::Banana', as => 'Cherry' );
-    Catalyst::Utils::inject_component( into => __PACKAGE__, component => 't::Test::Apple', as => 'Apple' );
+    Catalyst::Utils::inject_component( into => __PACKAGE__, component => 'Test::Apple', as => 'Apple' );
 };
  
 TestCatalyst->config( 'home' => '.' );
@@ -35,7 +37,7 @@ package main;
  
 use Catalyst::Test qw/TestCatalyst/;
  
-ok( TestCatalyst->controller( $_ ) ) for qw/ Apple t::Test::Apple /;
+ok( TestCatalyst->controller( $_ ) ) for qw/ Apple Test::Apple /;
 ok( TestCatalyst->model( $_ ) ) for qw/ Banana Cherry /;
 
 done_testing;
diff --git a/t/lib/Test/Apple.pm b/t/lib/Test/Apple.pm
new file mode 100644 (file)
index 0000000..98b4df1
--- /dev/null
@@ -0,0 +1,14 @@
+package Test::Apple;
+
+use strict;
+use warnings;
+
+use parent qw/Catalyst::Controller/;
+
+sub default :Path {
+}
+
+sub apple :Local {
+}
+
+1;