[Catalyst-commits] r12719 - in
Catalyst-Plugin-Authentication/0.10000/trunk/t: . author lib
lib/AuthRealmTestApp/Controller
lib/AuthRealmTestAppCompat/Controller
lib/AuthRealmTestAppProgressive/Controller
lib/AuthSessionTestApp/Controller lib/AuthTestApp/Controller
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Fri Jan 22 21:55:20 GMT 2010
Author: rafl
Date: 2010-01-22 21:55:20 +0000 (Fri, 22 Jan 2010)
New Revision: 12719
Added:
Catalyst-Plugin-Authentication/0.10000/trunk/t/author/notabs.t
Modified:
Catalyst-Plugin-Authentication/0.10000/trunk/t/06_user.t
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestApp/Controller/Root.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppCompat/Controller/Root.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppProgressive/Controller/Root.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp/Controller/Root.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp/Controller/Root.pm
Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app.t
Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_session.t
Log:
Add a NoTabs test and make it pass.
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/06_user.t
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/06_user.t 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/06_user.t 2010-01-22 21:55:20 UTC (rev 12719)
@@ -12,20 +12,20 @@
}
{
- package SomeUser;
- use base $m;
+ package SomeUser;
+ use base $m;
- sub new { bless {}, shift };
+ sub new { bless {}, shift };
- sub supported_features {
- {
- feature => {
- subfeature => 1,
- unsupported_subfeature => 0,
- },
- top_level => 1,
- }
- }
+ sub supported_features {
+ {
+ feature => {
+ subfeature => 1,
+ unsupported_subfeature => 0,
+ },
+ top_level => 1,
+ }
+ }
sub get_object {
bless {}, 'SomeBaseUser';
}
@@ -40,11 +40,11 @@
ok( !$o->supports(qw/feature unsupported_subfeature/), "traversal terminating in false");
lives_ok {
- $o->supports("bad_key");
+ $o->supports("bad_key");
} "can check for non existent feature";
#dies_ok {
-# $o->supports(qw/bad_key subfeature/)
+# $o->supports(qw/bad_key subfeature/)
#} "but can't traverse into one";
lives_ok {
Added: Catalyst-Plugin-Authentication/0.10000/trunk/t/author/notabs.t
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/author/notabs.t (rev 0)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/author/notabs.t 2010-01-22 21:55:20 UTC (rev 12719)
@@ -0,0 +1,5 @@
+use strict;
+use warnings;
+use Test::NoTabs;
+
+all_perl_files_ok;
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestApp/Controller/Root.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestApp/Controller/Root.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -9,9 +9,9 @@
use Test::Exception;
sub moose : Local {
- my ( $self, $c ) = @_;
+ my ( $self, $c ) = @_;
- ok(!$c->user, "no user");
+ ok(!$c->user, "no user");
while ( my ($user, $info) = each %$AuthRealmTestApp::members ) {
@@ -35,7 +35,7 @@
$c->logout;
- # sanity check
+ # sanity check
ok(!$c->user, "no more user after logout");
}
@@ -62,12 +62,12 @@
$c->logout;
- # sanity check
+ # sanity check
ok(!$c->user, "no more user after logout");
}
- $c->res->body( "ok" );
+ $c->res->body( "ok" );
}
1;
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppCompat/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppCompat/Controller/Root.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppCompat/Controller/Root.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -9,7 +9,7 @@
use Test::Exception;
sub moose : Local {
- my ( $self, $c ) = @_;
+ my ( $self, $c ) = @_;
while ( my ($user, $info) = each %$AuthRealmTestAppCompat::members ) {
@@ -24,7 +24,7 @@
ok( $ok, "user $user authentication" );
}
- $c->res->body( "ok" );
+ $c->res->body( "ok" );
}
1;
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppProgressive/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppProgressive/Controller/Root.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthRealmTestAppProgressive/Controller/Root.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -9,7 +9,7 @@
use Test::Exception;
sub progressive : Local {
- my ( $self, $c ) = @_;
+ my ( $self, $c ) = @_;
foreach my $realm ( keys %AuthRealmTestAppProgressive::members ) {
while ( my ( $user, $info ) = each %{$AuthRealmTestAppProgressive::members{$realm}} ) {
@@ -23,7 +23,7 @@
ok( $c->user_in_realm($realm), "user in proper realm" );
}
}
- $c->res->body( "ok" );
+ $c->res->body( "ok" );
}
1;
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp/Controller/Root.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp/Controller/Root.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -11,25 +11,25 @@
use Digest::MD5 qw/md5/;
sub moose : Local {
- my ( $self, $c ) = @_;
+ my ( $self, $c ) = @_;
- ok(!$c->sessionid, "no session id yet");
- ok(!$c->user_exists, "no user exists");
- ok(!$c->user, "no user yet");
- ok($c->login( "foo", "s3cr3t" ), "can login with clear");
- is( $c->user, $AuthSessionTestApp::users->{foo}, "user object is in proper place");
+ ok(!$c->sessionid, "no session id yet");
+ ok(!$c->user_exists, "no user exists");
+ ok(!$c->user, "no user yet");
+ ok($c->login( "foo", "s3cr3t" ), "can login with clear");
+ is( $c->user, $AuthSessionTestApp::users->{foo}, "user object is in proper place");
}
sub elk : Local {
- my ( $self, $c ) = @_;
+ my ( $self, $c ) = @_;
- ok( $c->sessionid, "session ID was restored" );
- ok( $c->user_exists, "user exists" );
- ok( $c->user, "a user was also restored");
- is_deeply( $c->user, $AuthSessionTestApp::users->{foo}, "restored user is the right one (deep test - store might change identity)" );
+ ok( $c->sessionid, "session ID was restored" );
+ ok( $c->user_exists, "user exists" );
+ ok( $c->user, "a user was also restored");
+ is_deeply( $c->user, $AuthSessionTestApp::users->{foo}, "restored user is the right one (deep test - store might change identity)" );
- # Rename the user!
- $AuthSessionTestApp::users->{bar} = delete $AuthSessionTestApp::users->{foo};
+ # Rename the user!
+ $AuthSessionTestApp::users->{bar} = delete $AuthSessionTestApp::users->{foo};
}
sub yak : Local {
@@ -60,7 +60,7 @@
sub possum : Local {
my ( $self, $c ) = @_;
- ok( !$c->session_is_valid, "no session ID was restored");
+ ok( !$c->session_is_valid, "no session ID was restored");
$c->session->{definitely_not_a_user} = "moose";
}
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthSessionTestApp.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -10,20 +10,20 @@
use base qw/Catalyst/;
use Catalyst qw/
- Session
- Session::Store::Dummy
- Session::State::Cookie
+ Session
+ Session::Store::Dummy
+ Session::State::Cookie
- Authentication
- Authentication::Store::Minimal
- Authentication::Credential::Password
+ Authentication
+ Authentication::Store::Minimal
+ Authentication::Credential::Password
/;
our $users = {
- foo => User::SessionRestoring->new(
- id => 'foo',
- password => "s3cr3t",
- ),
+ foo => User::SessionRestoring->new(
+ id => 'foo',
+ password => "s3cr3t",
+ ),
};
__PACKAGE__->config(authentication => {users => $users});
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp/Controller/Root.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp/Controller/Root.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -14,44 +14,44 @@
sub number_of_elements { return scalar @_ }
sub moose : Local {
- my ( $self, $c ) = @_;
+ my ( $self, $c ) = @_;
- is(number_of_elements($c->user), 1, "Array undef");
- is($c->user, undef, "no user, returns undef");
- ok(!$c->user, "no user");
- ok($c->login( "foo", "s3cr3t" ), "can login with clear");
- is( $c->user, $AuthTestApp::users->{foo}, "user object is in proper place");
+ is(number_of_elements($c->user), 1, "Array undef");
+ is($c->user, undef, "no user, returns undef");
+ ok(!$c->user, "no user");
+ ok($c->login( "foo", "s3cr3t" ), "can login with clear");
+ is( $c->user, $AuthTestApp::users->{foo}, "user object is in proper place");
- ok( !$c->user->roles, "no roles for foo" );
- my @new = qw/foo bar gorch/;
- $c->user->roles( @new );
- is_deeply( [ $c->user->roles ], \@new, "roles set as array");
+ ok( !$c->user->roles, "no roles for foo" );
+ my @new = qw/foo bar gorch/;
+ $c->user->roles( @new );
+ is_deeply( [ $c->user->roles ], \@new, "roles set as array");
- $c->logout;
- ok(!$c->user, "no more user, after logout");
+ $c->logout;
+ ok(!$c->user, "no more user, after logout");
- ok($c->login( "bar", "s3cr3t" ), "can login with crypted");
- is( $c->user, $AuthTestApp::users->{bar}, "user object is in proper place");
- $c->logout;
+ ok($c->login( "bar", "s3cr3t" ), "can login with crypted");
+ is( $c->user, $AuthTestApp::users->{bar}, "user object is in proper place");
+ $c->logout;
- ok($c->login("gorch", "s3cr3t"), "can login with hashed");
- is( $c->user, $AuthTestApp::users->{gorch}, "user object is in proper place");
- $c->logout;
+ ok($c->login("gorch", "s3cr3t"), "can login with hashed");
+ is( $c->user, $AuthTestApp::users->{gorch}, "user object is in proper place");
+ $c->logout;
- ok($c->login("shabaz", "s3cr3t"), "can login with base64 hashed");
- is( $c->user, $AuthTestApp::users->{shabaz}, "user object is in proper place");
- $c->logout;
+ ok($c->login("shabaz", "s3cr3t"), "can login with base64 hashed");
+ is( $c->user, $AuthTestApp::users->{shabaz}, "user object is in proper place");
+ $c->logout;
- ok($c->login("sadeek", "s3cr3t"), "can login with padded base64 hashed");
- is( $c->user, $AuthTestApp::users->{sadeek}, "user object is in proper place");
- $c->logout;
+ ok($c->login("sadeek", "s3cr3t"), "can login with padded base64 hashed");
+ is( $c->user, $AuthTestApp::users->{sadeek}, "user object is in proper place");
+ $c->logout;
- ok(!$c->login( "bar", "bad pass" ), "can't login with bad password");
- ok(!$c->user, "no user");
+ ok(!$c->login( "bar", "bad pass" ), "can't login with bad password");
+ ok(!$c->user, "no user");
- throws_ok { $c->login( "baz", "foo" ) } qr/support.*mechanism/, "can't login without any supported mech";
+ throws_ok { $c->login( "baz", "foo" ) } qr/support.*mechanism/, "can't login without any supported mech";
- $c->res->body( "ok" );
+ $c->res->body( "ok" );
}
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp.pm
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp.pm 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/lib/AuthTestApp.pm 2010-01-22 21:55:20 UTC (rev 12719)
@@ -3,9 +3,9 @@
use warnings;
use base qw/Catalyst/;
use Catalyst qw/
- Authentication
- Authentication::Store::Minimal
- Authentication::Credential::Password
+ Authentication
+ Authentication::Store::Minimal
+ Authentication::Credential::Password
/;
use Digest::MD5 qw/md5/;
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app.t
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app.t 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app.t 2010-01-22 21:55:20 UTC (rev 12719)
@@ -5,7 +5,7 @@
BEGIN {
plan skip_all => "Digest::SHA1 is required for this test" unless eval { require Digest::SHA1 };
- plan "no_plan";
+ plan "no_plan";
}
use lib 't/lib';
Modified: Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_session.t
===================================================================
--- Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_session.t 2010-01-22 21:51:27 UTC (rev 12718)
+++ Catalyst-Plugin-Authentication/0.10000/trunk/t/live_app_session.t 2010-01-22 21:55:20 UTC (rev 12719)
@@ -4,8 +4,8 @@
use Test::More;
BEGIN {
- eval { require Test::WWW::Mechanize::Catalyst; require Catalyst::Plugin::Session; require Catalyst::Plugin::Session::State::Cookie };
- plan skip_all => "This test needs Test::WWW::Mechanize::Catalyst, Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed" if $@;
+ eval { require Test::WWW::Mechanize::Catalyst; require Catalyst::Plugin::Session; require Catalyst::Plugin::Session::State::Cookie };
+ plan skip_all => "This test needs Test::WWW::Mechanize::Catalyst, Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed" if $@;
plan skip_all => "This test needs Test::WWW::Mechanize::Catalyst >= 0.50, you have only $Test::WWW::Mechanize::Catalyst::VERSION"
unless $Test::WWW::Mechanize::Catalyst::VERSION >= 0.50;
}
More information about the Catalyst-commits
mailing list