[Bps-public-commit] r13401 - in Shipwright/trunk: t
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Wed Jun 18 17:11:21 EDT 2008
Author: sunnavy
Date: Wed Jun 18 17:11:21 2008
New Revision: 13401
Modified:
Shipwright/trunk/ (props changed)
Shipwright/trunk/t/71.script_create.t
Log:
r13536 at sunnavys-mb: sunnavy | 2008-06-18 23:52:06 +0800
refactor a bit to reduce code redundancy
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:11:21 2008
@@ -16,10 +16,7 @@
my $repo = create_svn_repo() . '/hello';
- my $cmd = [ $sw, 'create', '-r', "svn:$repo" ];
- unshift @$cmd, $^X, '-MDevel::Cover' if devel_cover_enabled;
- my $out = Shipwright::Util->run( $cmd );
- like( $out, qr/created with success/, "shipwright create -r 'svn:$repo'");
+ test_create( "svn:$repo" );
}
SKIP: {
@@ -30,8 +27,16 @@
my $repo = '//__shipwright/hello';
- my $cmd = [ $sw, 'create', '-r', "svn:$repo" ];
- unshift @$cmd, $^X, '-MDevel::Cover' if devel_cover_enabled;
- my $out = Shipwright::Util->run( [ $sw, 'create', '-r', "svk:$repo"] );
- like( $out, qr/created with success/, "shipwright create -r 'svk:$repo'");
+ test_create( "svk:$repo" );
+}
+
+my @cover_prefix = ( $^X, '-MDevel::Cover' );
+
+sub test_create {
+ 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'");
}
+
More information about the Bps-public-commit
mailing list