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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jun 16 11:10:07 EDT 2008


Author: sunnavy
Date: Mon Jun 16 11:10:07 2008
New Revision: 13324

Added:
   Shipwright/trunk/t/03.backend.t
Modified:
   Shipwright/trunk/   (props changed)

Log:
 r13446 at sunnavys-mb:  sunnavy | 2008-06-16 23:08:26 +0800
 added 03.backend.t


Added: Shipwright/trunk/t/03.backend.t
==============================================================================
--- (empty file)
+++ Shipwright/trunk/t/03.backend.t	Mon Jun 16 11:10:07 2008
@@ -0,0 +1,34 @@
+use strict;
+use warnings;
+
+use Test::More tests => 7;
+use Shipwright::Test;
+use Shipwright::Backend;
+
+Shipwright::Test->init;
+
+my %backend = (
+    'svk:/test/foo'              => 'SVK',
+    '//test/foo'                 => 'SVK',
+    'svn:file:///test/foo'       => 'SVN',
+    'svn://example.com/test/foo' => 'SVN',
+);
+
+for ( sort keys %backend ) {
+    my $backend = Shipwright::Backend->new( repository => $_ );
+    isa_ok( $backend, 'Shipwright::Backend::' . $backend{$_}, $_ );
+}
+
+my %invalid_backend = (
+    'foo' => 'invalid repository',
+    ''    => 'invalid repository',
+);
+
+for ( keys %invalid_backend ) {
+    eval { my $backend = Shipwright::Backend->new( repository => $_ ) };
+    like( $@, qr/$invalid_backend{$_}/, $invalid_backend{$_} );
+}
+
+eval { my $backend = Shipwright::Backend->new };
+like( $@, qr/need repository arg/, 'new need repository arg' );
+



More information about the Bps-public-commit mailing list