[Bps-public-commit] r12239 -

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon May 12 06:42:46 EDT 2008


Author: sunnavy
Date: Mon May 12 06:42:43 2008
New Revision: 12239

Modified:
   /   (props changed)
   Shipwright/trunk/t/01.repo_check.t

Log:
 r12244 at sunnavys-mb:  sunnavy | 2008-05-12 15:33:04 +0800
 added check_repository tests for svn


Modified: Shipwright/trunk/t/01.repo_check.t
==============================================================================
--- Shipwright/trunk/t/01.repo_check.t	(original)
+++ Shipwright/trunk/t/01.repo_check.t	Mon May 12 06:42:43 2008
@@ -6,7 +6,7 @@
 use File::Spec::Functions qw/catfile/;
 use File::Temp qw/tempdir/;
 
-use Test::More tests => 4;
+use Test::More tests => 8;
 
 my $shipwright = Shipwright->new( log_level => 'fatal', repository => '//foo' );
 
@@ -21,11 +21,11 @@
     my %map = (
         create => {
             '//__shipwright/foo' => 1,
-            'svk:/noexists/'          => 0,
+            'svk:/noexists/'     => 0,
         },
         list => {
             '//__shipwright/foo' => 0,
-            'svk:/noexists/'          => 0,
+            'svk:/noexists/'     => 0,
         },
     );
 
@@ -42,3 +42,35 @@
 
 }
 
+SKIP: {
+    skip "no svn found", 4
+      unless has_svn();
+
+    my $valid   = create_svn_repo();
+    my $invalid = 'svn:file:///aa/bb/cc';
+
+    # repo check for action 'create'
+
+    my %map = (
+        create => {
+            "svn:$valid" => 1,
+            $invalid     => 0,
+        },
+        list => {
+            "svn:$valid" => 0,
+            $invalid     => 0,
+        },
+    );
+
+    for my $action ( keys %map ) {
+        for my $repo ( keys %{ $map{$action} } ) {
+            my $backend = Shipwright::Backend->new( repository => $repo );
+            is(
+                $backend->check_repository( action => $action ),
+                $map{$action}{$repo},
+                "$repo for action $action",
+            );
+        }
+    }
+
+}



More information about the Bps-public-commit mailing list