tests for the config( ...->{file} ) option. addresses bug when ->{file} is a dir...
[catagits/Catalyst-Plugin-ConfigLoader.git] / t / lib / TestApp1 / Controller / Config.pm
diff --git a/t/lib/TestApp1/Controller/Config.pm b/t/lib/TestApp1/Controller/Config.pm
new file mode 100644 (file)
index 0000000..95ddd93
--- /dev/null
@@ -0,0 +1,19 @@
+package TestApp1::Controller::Config;
+
+use strict;
+use warnings;
+
+use base qw( Catalyst::Controller );
+
+sub index : Private {
+    my ( $self, $c ) = @_;
+    $c->res->output( $self->{ foo } );
+}
+
+sub appconfig : Global {
+    my ( $self, $c, $var ) = @_;
+
+    $c->res->body( $c->config->{ $var } );
+}
+
+1;