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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jun 16 09:59:27 EDT 2008


Author: sunnavy
Date: Mon Jun 16 09:59:26 2008
New Revision: 13321

Added:
   Shipwright/trunk/t/02.shipwright.t
Modified:
   Shipwright/trunk/   (props changed)

Log:
 r13440 at sunnavys-mb:  sunnavy | 2008-06-16 21:52:38 +0800
 added t/02.shipwright.t


Added: Shipwright/trunk/t/02.shipwright.t
==============================================================================
--- (empty file)
+++ Shipwright/trunk/t/02.shipwright.t	Mon Jun 16 09:59:26 2008
@@ -0,0 +1,30 @@
+use strict;
+use warnings;
+
+use Test::More tests => 11;
+use Shipwright;
+
+my $sw = Shipwright->new( repository => 'svk:/test/foo', source =>
+        'cpan:Jifty' );
+isa_ok( $sw->backend, 'Shipwright::Backend::SVK', '$sw->backend' );
+isa_ok( $sw->source, 'Shipwright::Source::CPAN', '$sw->source' );
+isa_ok( $sw->build, 'Shipwright::Build', '$sw->build' );
+
+like( $sw->log_file, qr/svk__test_foo\.log$/, 'default log_file' );
+is( $sw->log_level, 'FATAL', 'default log_level is FATAL' );
+
+$sw = Shipwright->new(
+    log_file   => '/tmp/t.log',
+    log_level  => 'ERROR'
+);
+
+is( $sw->backend, undef, 'no repository, no backend' );
+is( $sw->build, undef, 'no repository, no build' );
+is( $sw->source, undef, 'no source, no backend' );
+
+is( $sw->log_file,  '/tmp/t.log', 'log_file arg is ok' );
+is( $sw->log_level, 'ERROR',      'log_level arg is ok' );
+
+$sw = Shipwright->new( repository => 'svk:/test/foo', log_level => 'erROr' );
+is( $sw->log_level, 'ERROR', 'log_level which is not upper case is ok' );
+



More information about the Bps-public-commit mailing list