Fix and test failure to merge include paths
[catagits/Catalyst-Plugin-Static-Simple.git] / t / lib / IncTestApp.pm
diff --git a/t/lib/IncTestApp.pm b/t/lib/IncTestApp.pm
new file mode 100644 (file)
index 0000000..a11b438
--- /dev/null
@@ -0,0 +1,46 @@
+package IncTestApp;\r
+# FIXME: I have to do this because TestApp runs setup at compile time\r
+# Perhaps it would be better to let the tests run setup?\r
+\r
+use strict;\r
+use Catalyst;\r
+use FindBin;\r
+use TestLog;\r
+\r
+our $VERSION = '0.01';\r
+\r
+IncTestApp->config(\r
+    name => 'TestApp',\r
+    debug => 1,\r
+    static => {\r
+        include_path => [\r
+            IncTestApp->config->{root},\r
+        ]\r
+    },\r
+    'Plugin::Static::Simple' => {\r
+        include_path => [\r
+            IncTestApp->config->{root} . '/overlay',\r
+        ]\r
+    },\r
+);\r
+\r
+IncTestApp->log( TestLog->new );\r
+my @plugins = qw/Static::Simple/;\r
+\r
+# load the SubRequest plugin if available\r
+eval { \r
+    require Catalyst::Plugin::SubRequest; \r
+    die unless Catalyst::Plugin::SubRequest->VERSION ge '0.08';\r
+};\r
+push @plugins, 'SubRequest' unless ($@);\r
+\r
+IncTestApp->setup( @plugins );\r
+\r
+sub incpath_generator {\r
+    my $c = shift;\r
+    \r
+    return [ $c->config->{root} . '/incpath' ];\r
+}\r
+\r
+\r
+1;\r