[Bps-public-commit] r13813 - in Prophet/trunk: t

jesse at bestpractical.com jesse at bestpractical.com
Sat Jul 5 04:45:34 EDT 2008


Author: jesse
Date: Sat Jul  5 04:45:33 2008
New Revision: 13813

Modified:
   Prophet/trunk/lib/Prophet/Record.pm
   Prophet/trunk/t/simple-push.t

Log:
* Fix tests to not fail on native replicas (fixed an assumption about svn replicas in the tests)
* Warnings avoidance

Modified: Prophet/trunk/lib/Prophet/Record.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Record.pm	(original)
+++ Prophet/trunk/lib/Prophet/Record.pm	Sat Jul  5 04:45:33 2008
@@ -118,7 +118,7 @@
             handle => $self->handle,
             type   => $collection_class->record_class->record_type
         );
-        $collection->matching( sub { $_[0]->prop( $args{by} ) eq $self->uuid }
+        $collection->matching( sub { ($_[0]->prop( $args{by} )||'') eq $self->uuid }
         );
         return $collection;
     };

Modified: Prophet/trunk/t/simple-push.t
==============================================================================
--- Prophet/trunk/t/simple-push.t	(original)
+++ Prophet/trunk/t/simple-push.t	Sat Jul  5 04:45:33 2008
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 
-use Prophet::Test tests => 12;
+use Prophet::Test tests => 14;
 
 as_alice {
     run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
@@ -46,11 +46,17 @@
 
 };
 
+my $changesets =   [ map { $_->as_hash } grep { $_->has_changes }  @$changesets ];
+my $seq = delete $changesets->[0]->{'sequence_no'};
+my $orig_seq = delete $changesets->[0]->{'original_sequence_no'};
+is($seq, $orig_seq);
+
+
 is_deeply(
-    [ map { $_->as_hash } grep { $_->has_changes }  @$changesets ],
+   $changesets,
     [ 
-        {   'sequence_no'          => 3,
-            'original_sequence_no' => 3,
+        {   #'sequence_no'          => 3,
+            #'original_sequence_no' => 3, # the number is different on different replica types
             'original_source_uuid' => replica_uuid_for('bob'),
             'is_resolution'        => undef,
             'source_uuid'          => replica_uuid_for('bob'),
@@ -100,10 +106,16 @@
 
 my @changes = map { $_->as_hash } grep { $_->has_changes } @$changesets;
 
+my $seq = delete @changes[0]->{'sequence_no'};
+my $orig_seq = delete @changes[0]->{'original_sequence_no'};
+is($seq, $orig_seq);
+
 is_deeply(
     \@changes,
-    [   {   'sequence_no'          => 4,
-            'original_sequence_no' => 4,
+    [   {  
+        
+        #     'sequence_no'          => 4,  # the number varies based on replica type
+        #    'original_sequence_no' => 4,
             'original_source_uuid' => replica_uuid_for('bob'),
             'is_resolution'        => undef,
             'source_uuid'          => replica_uuid_for('bob'),



More information about the Bps-public-commit mailing list