[Bast-commits] r6142 - in DBIx-Class/0.08/branches/storage-tweaks: lib/DBIx/Class/Storage/DBI t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Wed May 6 03:13:56 GMT 2009


Author: caelum
Date: 2009-05-06 03:13:56 +0000 (Wed, 06 May 2009)
New Revision: 6142

Modified:
   DBIx-Class/0.08/branches/storage-tweaks/lib/DBIx/Class/Storage/DBI/Replicated.pm
   DBIx-Class/0.08/branches/storage-tweaks/t/93storage_replication.t
Log:
fix ::DBI::Replicated::all_storages

Modified: DBIx-Class/0.08/branches/storage-tweaks/lib/DBIx/Class/Storage/DBI/Replicated.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-tweaks/lib/DBIx/Class/Storage/DBI/Replicated.pm	2009-05-06 00:33:14 UTC (rev 6141)
+++ DBIx-Class/0.08/branches/storage-tweaks/lib/DBIx/Class/Storage/DBI/Replicated.pm	2009-05-06 03:13:56 UTC (rev 6142)
@@ -412,7 +412,7 @@
   my $self = shift @_;
   return grep {defined $_ && blessed $_} (
      $self->master,
-     $self->replicants,
+     values %{ $self->replicants },
   );
 }
 

Modified: DBIx-Class/0.08/branches/storage-tweaks/t/93storage_replication.t
===================================================================
--- DBIx-Class/0.08/branches/storage-tweaks/t/93storage_replication.t	2009-05-06 00:33:14 UTC (rev 6141)
+++ DBIx-Class/0.08/branches/storage-tweaks/t/93storage_replication.t	2009-05-06 03:13:56 UTC (rev 6142)
@@ -10,7 +10,7 @@
     eval "use DBIx::Class::Storage::DBI::Replicated; use Test::Moose";
     plan $@
         ? ( skip_all => "Deps not installed: $@" )
-        : ( tests => 79 );
+        : ( tests => 82 );
 }
 
 use_ok 'DBIx::Class::Storage::DBI::Replicated::Pool';
@@ -223,6 +223,15 @@
 
 ok my @replicated_storages = $replicated->schema->storage->connect_replicants(@replicant_connects)
     => 'Created some storages suitable for replicants';
+
+ok my @all_storages = $replicated->schema->storage->all_storages
+    => '->all_storages';
+
+ok @all_storages == 3
+    => 'correct number of ->all_storages';
+
+ok ((grep $_->isa('DBIx::Class::Storage::DBI'), @all_storages) == 3
+    => '->all_storages are correct type');
  
 my @replicant_names = keys %{ $replicated->schema->storage->replicants };
 




More information about the Bast-commits mailing list