[Catalyst-commits] r10149 - in Catalyst-Authentication-Credential-HTTP/1.000/trunk/t: . lib

dhoss at dev.catalyst.perl.org dhoss at dev.catalyst.perl.org
Thu May 14 07:58:08 GMT 2009


Author: dhoss
Date: 2009-05-14 07:58:07 +0000 (Thu, 14 May 2009)
New Revision: 10149

Added:
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm
Modified:
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app.t
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t
Log:
moved tests out and into t/lib/


Added: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm	                        (rev 0)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthDigestTestApp.pm	2009-05-14 07:58:07 UTC (rev 10149)
@@ -0,0 +1,40 @@
+package AuthDigestTestApp;
+    use Catalyst qw/
+      Authentication
+      Cache
+      /;
+    
+    our %users;
+    sub moose : Local {
+        my ( $self, $c ) = @_;
+        #$c->authenticate( { realm => 'testrealm at host.com' } );
+        $c->authenticate();
+        $c->res->body( $c->user->id );
+    }
+    my $digest_pass = Digest::MD5->new;
+    $digest_pass->add('Mufasa2:testrealm at host.com:Circle Of Life');
+    %users = ( 
+        Mufasa  => { pass         => "Circle Of Life",          }, 
+        Mufasa2 => { pass         => $digest_pass->hexdigest, },
+    );
+    __PACKAGE__->config->{cache}{backend} = {
+        class => 'Cache::FileCache',
+    };
+    __PACKAGE__->config( authentication => {
+        default_realm => 'testrealm at host.com',
+        realms => {
+            'testrealm at host.com' => {
+                store => {
+                    class => 'Minimal',
+                    users => \%users,
+                },
+                credential => {
+                    class => 'HTTP',
+                    type  => 'digest',
+                    password_type => 'clear', 
+                    password_field => 'pass'
+                },
+            },
+        },
+    });
+    __PACKAGE__->setup;

Added: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm	                        (rev 0)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/lib/AuthTestApp.pm	2009-05-14 07:58:07 UTC (rev 10149)
@@ -0,0 +1,34 @@
+package AuthTestApp;
+    use Catalyst qw/
+      Authentication
+      /;
+    our %users;
+    __PACKAGE__->config(authentication => {
+        default_realm => 'test',
+        realms => {
+            test => {
+                store => { 
+                    class => 'Minimal',
+                    users => \%users,
+                },
+                credential => { 
+                    class => 'HTTP', 
+                    type  => 'basic',
+                    password_type => 'clear', 
+                    password_field => 'password'
+                },
+            },
+        },
+    });
+    sub auto : Private {
+        my ($self, $c) = @_;
+        $c->authenticate();
+    }
+    sub moose : Local {
+        my ( $self, $c ) = @_;
+	    $c->res->body( $c->user->id );
+    }
+    %users = (
+        foo => { password         => "s3cr3t", },
+    );
+    __PACKAGE__->setup;

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app.t
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app.t	2009-05-14 03:46:49 UTC (rev 10148)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app.t	2009-05-14 07:58:07 UTC (rev 10149)
@@ -9,43 +9,8 @@
     plan tests => 4;
 }
 use HTTP::Request;
-{
-    package AuthTestApp;
-    use Catalyst qw/
-      Authentication
-      /;
-    use Test::More;
-    our %users;
-    __PACKAGE__->config(authentication => {
-        default_realm => 'test',
-        realms => {
-            test => {
-                store => { 
-                    class => 'Minimal',
-                    users => \%users,
-                },
-                credential => { 
-                    class => 'HTTP', 
-                    type  => 'basic',
-                    password_type => 'clear', 
-                    password_field => 'password'
-                },
-            },
-        },
-    });
-    sub auto : Private {
-        my ($self, $c) = @_;
-        $c->authenticate();
-    }
-    sub moose : Local {
-        my ( $self, $c ) = @_;
-	    $c->res->body( $c->user->id );
-    }
-    %users = (
-        foo => { password         => "s3cr3t", },
-    );
-    __PACKAGE__->setup;
-}
+
+use Test::More;
 use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/;
 my $mech = Test::WWW::Mechanize::Catalyst->new;
 $mech->get("http://localhost/moose");

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t	2009-05-14 03:46:49 UTC (rev 10148)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t	2009-05-14 07:58:07 UTC (rev 10149)
@@ -16,49 +16,8 @@
 }
 use Digest::MD5;
 use HTTP::Request;
-{
-    package AuthTestApp;
-    use Catalyst qw/
-      Authentication
-      Cache
-      /;
-    use Test::More;
-    our %users;
-    sub moose : Local {
-        my ( $self, $c ) = @_;
-        #$c->authenticate( { realm => 'testrealm at host.com' } );
-        $c->authenticate();
-        $c->res->body( $c->user->id );
-    }
-    my $digest_pass = Digest::MD5->new;
-    $digest_pass->add('Mufasa2:testrealm at host.com:Circle Of Life');
-    %users = ( 
-        Mufasa  => { pass         => "Circle Of Life",          }, 
-        Mufasa2 => { pass         => $digest_pass->hexdigest, },
-    );
-    __PACKAGE__->config->{cache}{backend} = {
-        class => 'Cache::FileCache',
-    };
-    __PACKAGE__->config( authentication => {
-        default_realm => 'testrealm at host.com',
-        realms => {
-            'testrealm at host.com' => {
-                store => {
-                    class => 'Minimal',
-                    users => \%users,
-                },
-                credential => {
-                    class => 'HTTP',
-                    type  => 'digest',
-                    password_type => 'clear', 
-                    password_field => 'pass'
-                },
-            },
-        },
-    });
-    __PACKAGE__->setup;
-}
-use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/;
+use Test::More;
+use Test::WWW::Mechanize::Catalyst qw/AuthDigestTestApp/;
 
 sub do_test {
     my $username = shift;




More information about the Catalyst-commits mailing list