[Catalyst-commits] r11571 - in
Catalyst-Plugin-Session-State-Cookie/trunk: .
lib/Catalyst/Plugin/Session/State t
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Fri Oct 16 15:48:39 GMT 2009
Author: rafl
Date: 2009-10-16 15:48:37 +0000 (Fri, 16 Oct 2009)
New Revision: 11571
Modified:
Catalyst-Plugin-Session-State-Cookie/trunk/Makefile.PL
Catalyst-Plugin-Session-State-Cookie/trunk/lib/Catalyst/Plugin/Session/State/Cookie.pm
Catalyst-Plugin-Session-State-Cookie/trunk/t/basic.t
Log:
Port to new session config key.
Modified: Catalyst-Plugin-Session-State-Cookie/trunk/Makefile.PL
===================================================================
--- Catalyst-Plugin-Session-State-Cookie/trunk/Makefile.PL 2009-10-16 15:36:22 UTC (rev 11570)
+++ Catalyst-Plugin-Session-State-Cookie/trunk/Makefile.PL 2009-10-16 15:48:37 UTC (rev 11571)
@@ -4,7 +4,7 @@
all_from 'lib/Catalyst/Plugin/Session/State/Cookie.pm';
requires 'Catalyst' => '5.80005';
-requires 'Catalyst::Plugin::Session' => '0.19';
+requires 'Catalyst::Plugin::Session' => '0.27';
requires 'MRO::Compat';
requires 'Moose';
requires 'namespace::autoclean';
Modified: Catalyst-Plugin-Session-State-Cookie/trunk/lib/Catalyst/Plugin/Session/State/Cookie.pm
===================================================================
--- Catalyst-Plugin-Session-State-Cookie/trunk/lib/Catalyst/Plugin/Session/State/Cookie.pm 2009-10-16 15:36:22 UTC (rev 11570)
+++ Catalyst-Plugin-Session-State-Cookie/trunk/lib/Catalyst/Plugin/Session/State/Cookie.pm 2009-10-16 15:48:37 UTC (rev 11571)
@@ -11,14 +11,6 @@
has _deleted_session_id => ( is => 'rw' );
-# FIXME - Can go away when we dep on new Session..
-sub _session_plugin_config {
- my $c = shift;
- my $key = $c->config->{'Plugin::Session'} ?
- 'Plugin::Session' : 'session';
- $c->config->{$key} ||= {};
-}
-
sub setup_session {
my $c = shift;
Modified: Catalyst-Plugin-Session-State-Cookie/trunk/t/basic.t
===================================================================
--- Catalyst-Plugin-Session-State-Cookie/trunk/t/basic.t 2009-10-16 15:36:22 UTC (rev 11570)
+++ Catalyst-Plugin-Session-State-Cookie/trunk/t/basic.t 2009-10-16 15:48:37 UTC (rev 11571)
@@ -5,6 +5,8 @@
use Test::More tests => 13;
+use Catalyst::Plugin::Session;
+
my $m;
BEGIN { use_ok( $m = "Catalyst::Plugin::Session::State::Cookie" ) }
@@ -23,7 +25,13 @@
$res_meta->add_method( cookies => sub { $cookies_called++; \%res_cookies });
my $res = $res_meta->name->new;
-my $cxt_meta = Class::MOP::Class->create_anon_class( superclasses => ["Catalyst::Plugin::Session::State::Cookie", 'Moose::Object'] );
+my $cxt_meta = Class::MOP::Class->create_anon_class(
+ superclasses => [qw/
+ Catalyst::Plugin::Session
+ Catalyst::Plugin::Session::State::Cookie
+ Moose::Object
+ /],
+);
my $config = {};
$cxt_meta->add_method( config => sub { $config });
@@ -40,10 +48,10 @@
my $cxt = $cxt_meta->name->new;
$cxt->setup_session;
-like( $config->{session}{cookie_name},
+like( $config->{'Plugin::Session'}{cookie_name},
qr/_session$/, "default cookie name is set" );
-$config->{session}{cookie_name} = "session";
+$config->{'Plugin::Session'}{cookie_name} = "session";
can_ok( $m, "get_session_id" );
More information about the Catalyst-commits
mailing list