Add a NoTabs test and make it pass.
Florian Ragwitz [Fri, 22 Jan 2010 21:55:20 +0000 (21:55 +0000)]
t/06_user.t
t/author/notabs.t [new file with mode: 0644]
t/lib/AuthRealmTestApp/Controller/Root.pm
t/lib/AuthRealmTestAppCompat/Controller/Root.pm
t/lib/AuthRealmTestAppProgressive/Controller/Root.pm
t/lib/AuthSessionTestApp.pm
t/lib/AuthSessionTestApp/Controller/Root.pm
t/lib/AuthTestApp.pm
t/lib/AuthTestApp/Controller/Root.pm
t/live_app.t
t/live_app_session.t

index 244335e..62db266 100644 (file)
@@ -12,20 +12,20 @@ my $m; BEGIN { use_ok($m = "Catalyst::Authentication::User") }
 }
 
 {
-       package SomeUser;
-       use base $m;
-
-       sub new { bless {}, shift };
-
-       sub supported_features {
-               {
-                       feature => {
-                               subfeature => 1,
-                               unsupported_subfeature => 0,
-                       },
-                       top_level => 1,
-               }
-       }
+    package SomeUser;
+    use base $m;
+
+    sub new { bless {}, shift };
+
+    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 subfeature/), "traversal");
 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 {
diff --git a/t/author/notabs.t b/t/author/notabs.t
new file mode 100644 (file)
index 0000000..70b743a
--- /dev/null
@@ -0,0 +1,5 @@
+use strict;
+use warnings;
+use Test::NoTabs;
+
+all_perl_files_ok;
index 347f3d6..290d6cc 100644 (file)
@@ -9,9 +9,9 @@ use Test::More;
 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 @@ sub moose : Local {
 
         $c->logout;
 
-           # sanity check
+        # sanity check
         ok(!$c->user, "no more user after logout");
 
     }
@@ -62,12 +62,12 @@ sub moose : Local {
 
         $c->logout;
 
-           # sanity check
+        # sanity check
         ok(!$c->user, "no more user after logout");
 
     }
 
-       $c->res->body( "ok" );
+    $c->res->body( "ok" );
 }
 
 1;
index 9083896..8aa6415 100644 (file)
@@ -9,7 +9,7 @@ use Test::More;
 use Test::Exception;
 
 sub moose : Local {
-       my ( $self, $c ) = @_;
+    my ( $self, $c ) = @_;
 
     while ( my ($user, $info) = each %$AuthRealmTestAppCompat::members ) {
 
@@ -24,7 +24,7 @@ sub moose : Local {
         ok( $ok,                "user $user authentication" );
     }
 
-       $c->res->body( "ok" );
+    $c->res->body( "ok" );
 }
 
 1;
index 62f89b4..8e48623 100644 (file)
@@ -9,7 +9,7 @@ use Test::More;
 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 @@ sub progressive : Local {
             ok( $c->user_in_realm($realm), "user in proper realm" );
         }
     }
-       $c->res->body( "ok" );
+    $c->res->body( "ok" );
 }
 
 1;
index e1db298..ce13b00 100644 (file)
@@ -10,20 +10,20 @@ use warnings;
 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});
index 2475553..e9494d4 100644 (file)
@@ -11,25 +11,25 @@ use Test::Exception;
 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 fluffy_bunny : Local {
 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";
 
 }
index c7c49df..ce0144d 100644 (file)
@@ -3,9 +3,9 @@ use strict;
 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/;
index c2751fa..b200c5e 100644 (file)
@@ -14,44 +14,44 @@ use Digest::SHA1 qw/sha1_base64/;
 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" );
 }
 
 
index 4d55cd5..af9042c 100644 (file)
@@ -5,7 +5,7 @@ use Test::More;
 
 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';
index ac99352..756605e 100644 (file)
@@ -4,8 +4,8 @@ use warnings;
 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;
 }