View::TT, added tests from dwc
[catagits/Catalyst-View-TT.git] / lib / Catalyst / View / TT.pm
index 547211f..6b7a828 100644 (file)
@@ -6,7 +6,7 @@ use Template;
 use Template::Timer;
 use NEXT;
 
-our $VERSION = '0.17';
+our $VERSION = '0.20';
 
 __PACKAGE__->mk_accessors('template');
 
@@ -30,9 +30,9 @@ Catalyst::View::TT - Template View Class
               MyApp->path_to( 'root', 'src' ), 
               MyApp->path_to( 'root', 'lib' ), 
             ],
-            PRE_PROCESS => 'config/main',
-            WRAPPER     => 'site/wrapper',
-           TEMPLATE_EXTENSION => '.tt',
+            PRE_PROCESS        => 'config/main',
+            WRAPPER            => 'site/wrapper',
+            TEMPLATE_EXTENSION => '.tt',
 
             # two optional config items
             CATALYST_VAR => 'Catalyst',
@@ -255,7 +255,7 @@ sub new {
         $c->log->debug( "TT Config: ", Dumper($config) );
     }
 
-    return $class->NEXT::new(
+    my $self = $class->NEXT::new(
         $c,
         {
             template => Template->new($config) || do {
@@ -263,10 +263,13 @@ sub new {
                 $c->log->error($error);
                 $c->error($error);
                 return undef;
-              }
-        },
+              },
         %{$config},
+        },
     );
+    $self->config($config);
+
+    return $self;
 }
 
 =item process