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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon May 12 12:14:45 EDT 2008


Author: sunnavy
Date: Mon May 12 12:14:45 2008
New Revision: 12264

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/t/10.flags.t

Log:
 r12294 at sunnavys-mb:  sunnavy | 2008-05-13 00:14:15 +0800
 updated flags test


Modified: Shipwright/trunk/t/10.flags.t
==============================================================================
--- Shipwright/trunk/t/10.flags.t	(original)
+++ Shipwright/trunk/t/10.flags.t	Mon May 12 12:14:45 2008
@@ -16,7 +16,7 @@
 
     my $shipwright = Shipwright->new(
         repository => "svk:$repo",
-        log_level => 'FATAL',
+        log_level  => 'FATAL',
     );
 
     test_flags( shipwright => $shipwright, name => 'foo' );
@@ -31,7 +31,7 @@
 
     my $shipwright = Shipwright->new(
         repository => "svn:$repo",
-        log_level => 'FATAL',
+        log_level  => 'FATAL',
     );
 
     test_flags( shipwright => $shipwright, name => 'foo' );
@@ -39,21 +39,29 @@
 }
 
 sub test_flags {
-    my %args = @_;
+    my %args       = @_;
     my $shipwright = $args{shipwright};
-    my $name = $args{name};
+    my $name       = $args{name};
 
     # init
     $shipwright->backend->initialize();
 
-    my $flags = $shipwright->backend->flags( name => 'hello' );
-    is_deeply( $flags, [], 'initial flags are []' );
+    my $flags = $shipwright->backend->flags;
+    is_deeply( $flags->{$name}, undef, 'initial flags are undef' );
 
-    $shipwright->backend->flags( name => 'hello', flags => [ 'foo', 'bar' ] );
-    $flags = $shipwright->backend->flags( name => 'hello' );
-    is_deeply( $flags, [ 'foo', 'bar' ], "set flags to ['foo', 'bar']" );
-
-    $shipwright->backend->flags( name => 'hello', flags => [] );
-    $flags = $shipwright->backend->flags( name => 'hello' );
-    is_deeply( $flags, [], "set flags to []" );
+    $flags->{$name} = [ 'foo', 'bar' ];
+    $shipwright->backend->flags($flags);
+
+    $flags = $shipwright->backend->flags;
+    is_deeply(
+        $flags->{$name},
+        [ 'foo', 'bar' ],
+        "set flags to ['foo', 'bar']"
+    );
+
+    $flags->{$name} = [];
+    $shipwright->backend->flags($flags);
+
+    $flags = $shipwright->backend->flags;
+    is_deeply( $flags->{$name}, [], "set flags to []" );
 }



More information about the Bps-public-commit mailing list