[Catalyst-commits] r7813 - in trunk/Catalyst-Plugin-Cache: . t

kane at dev.catalyst.perl.org kane at dev.catalyst.perl.org
Tue May 27 10:08:09 BST 2008


Author: kane
Date: 2008-05-27 10:08:09 +0100 (Tue, 27 May 2008)
New Revision: 7813

Modified:
   trunk/Catalyst-Plugin-Cache/
   trunk/Catalyst-Plugin-Cache/t/basic.t
   trunk/Catalyst-Plugin-Cache/t/currying_conf.t
   trunk/Catalyst-Plugin-Cache/t/key_regexes.t
Log:
 r5391 at coke:  josboum | 2008-05-27 11:08:04 +0200
 * previous fixes introduced a regression; 
   According to the docs, you can not set up C::P::Cache without specifying a cache
   backend, but the tests did do this, and then registered a backend later.
 
   This only worked because a croak in the C::P::Cache code was caught by an eval
   and ignored, but the registering of the backend was done *before* the first
   request to the cache.
   Had a request gone to the cache first, it would have called the following code:
 
   sub temporary_cache_backend {
       my $c = shift;
       die "FIXME - make up an in memory cache backend, that hopefully works well for the current engine";
   }
 
   This commit fixes the above issue by specifying a cache backend explicitly.
   This is completely in line with what the documentation tells us to do.
 



Property changes on: trunk/Catalyst-Plugin-Cache
___________________________________________________________________
Name: svk:merge
   - 391f84f8-cfa2-4f6b-a47d-f52c5dc88d86:/local/catalyst-plugin-cache:5389
   + 391f84f8-cfa2-4f6b-a47d-f52c5dc88d86:/local/catalyst-plugin-cache:5391

Modified: trunk/Catalyst-Plugin-Cache/t/basic.t
===================================================================
--- trunk/Catalyst-Plugin-Cache/t/basic.t	2008-05-27 08:49:26 UTC (rev 7812)
+++ trunk/Catalyst-Plugin-Cache/t/basic.t	2008-05-27 09:08:09 UTC (rev 7813)
@@ -16,7 +16,16 @@
     
     sub registered_plugins {}
 
-    my %config;
+    ### must register a backend class as of 0.06
+    ### the previous code simply ignored a croak
+    ### this is still in line with the documentation.
+    my %config = (
+        cache   => { 
+            backend => { 
+                class   => 'Catalyst::Plugin::Cache::Backend::Memory',
+            }
+        }            
+    );
     sub config { \%config };
 }
 

Modified: trunk/Catalyst-Plugin-Cache/t/currying_conf.t
===================================================================
--- trunk/Catalyst-Plugin-Cache/t/currying_conf.t	2008-05-27 08:49:26 UTC (rev 7812)
+++ trunk/Catalyst-Plugin-Cache/t/currying_conf.t	2008-05-27 09:08:09 UTC (rev 7813)
@@ -22,11 +22,18 @@
                 },
                 bar => bless( {}, "SomeClass" ),
             },
+            ### as of 0.06, we need a specific backend
+            ### specified
+            backend => { 
+                class   => 'SomeClass',
+            }
         },
     );
     sub config { \%config };
 
     package SomeClass;
+    ### backend must have a constructor
+    sub new { bless {}, shift };
     sub get {}
     sub set {}
     sub remove {}

Modified: trunk/Catalyst-Plugin-Cache/t/key_regexes.t
===================================================================
--- trunk/Catalyst-Plugin-Cache/t/key_regexes.t	2008-05-27 08:49:26 UTC (rev 7812)
+++ trunk/Catalyst-Plugin-Cache/t/key_regexes.t	2008-05-27 09:08:09 UTC (rev 7813)
@@ -20,6 +20,10 @@
                 qr/^foo/ => "foo_store",
                 qr/^bar/ => "bar_store",
             ],
+            ### as of 0.06, you must specify a backend
+            backend => { 
+                class   => 'Catalyst::Plugin::Cache::Backend::Memory',
+            }
         },
     );
     sub config { \%config }




More information about the Catalyst-commits mailing list