[Bps-public-commit] r13404 - in Shipwright/trunk: t

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Jun 18 17:12:00 EDT 2008


Author: sunnavy
Date: Wed Jun 18 17:12:00 2008
New Revision: 13404

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/t/71.script_create.t

Log:
 r13539 at sunnavys-mb:  sunnavy | 2008-06-19 02:46:22 +0800
 more tests for cmd


Modified: Shipwright/trunk/t/71.script_create.t
==============================================================================
--- Shipwright/trunk/t/71.script_create.t	(original)
+++ Shipwright/trunk/t/71.script_create.t	Wed Jun 18 17:12:00 2008
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 2;
+use Test::More tests => 8;
 
 use Shipwright;
 use Shipwright::Test;
@@ -11,32 +11,40 @@
 Shipwright::Test->init;
 
 SKIP: {
-    skip "no svn found", 1
+    skip "no svn found", 4
       unless has_svn();
 
-    my $repo = create_svn_repo() . '/hello';
+    my $repo = 'svn:' . create_svn_repo() . '/hello';
 
-    test_create( "svn:$repo" );
+    start_test($repo);
 }
 
 SKIP: {
-    skip "no svk and svnadmin found", 1
+    skip "no svk and svnadmin found", 4
       unless has_svk();
 
     create_svk_repo();
 
-    my $repo = '//__shipwright/hello';
+    my $repo = 'svk://__shipwright/hello';
+    start_test($repo);
 
-    test_create( "svk:$repo" );
 }
 
-my @cover_prefix = ( $^X, '-MDevel::Cover' );
-
-sub test_create {
+sub start_test {
     my $repo = shift;
-    my $cmd = [ $sw, 'create', '-r', "$repo" ];
-    unshift @$cmd, @cover_prefix if devel_cover_enabled;
-    my $out = Shipwright::Util->run( $cmd );
-    like( $out, qr/created with success/, "shipwright create -r 'svn:$repo'");
+    test_cmd(
+        $repo,
+        [ $sw, 'create', '-r', $repo ],
+        qr/created with success/,
+        "create $repo"
+    );
+    test_cmd( $repo, [ $sw, 'list', '-r', $repo ], '', "list null $repo" );
+    test_cmd(
+        $repo,
+        [ $sw, 'list', '-r', $repo, '--name', 'foo' ],
+        qr/foo doesn't exist/,
+        "list non exist name $repo"
+    );
+    test_cmd( $repo, [ $sw, 'import', '-r', $repo ], '', "list null $repo" );
 }
 



More information about the Bps-public-commit mailing list