Proper fix for t/storage/replicated.t (augments 617474ab7e)
Peter Rabbitson [Wed, 2 Oct 2013 06:42:48 +0000 (08:42 +0200)]
Instead of blindly changing the use_ok to use figured out and moved together
the pieces responsible for the dance in the 1st place

t/storage/replicated.t

index cadd085..dfd3870 100644 (file)
@@ -31,10 +31,26 @@ note "Using Moose version $Moose::VERSION and MooseX::Types version $MooseX::Typ
 
 my $var_dir = quotemeta ( File::Spec->catdir(qw/t var/) );
 
-use DBIx::Class::Storage::DBI::Replicated::Pool;
-use DBIx::Class::Storage::DBI::Replicated::Balancer;
-use DBIx::Class::Storage::DBI::Replicated::Replicant;
+## Add a connect_info option to test option merging.
 use DBIx::Class::Storage::DBI::Replicated;
+{
+    package DBIx::Class::Storage::DBI::Replicated;
+
+    use Moose;
+
+    __PACKAGE__->meta->make_mutable;
+
+    around connect_info => sub {
+      my ($next, $self, $info) = @_;
+      $info->[3]{master_option} = 1;
+      $self->$next($info);
+    };
+
+    __PACKAGE__->meta->make_immutable;
+
+    no Moose;
+}
+
 
 
 =head1 HOW TO USE
@@ -124,27 +140,6 @@ TESTSCHEMACLASSES: {
     sub cleanup {}
 
     ## --------------------------------------------------------------------- ##
-    ## Add a connect_info option to test option merging.
-    ## --------------------------------------------------------------------- ##
-    {
-    package DBIx::Class::Storage::DBI::Replicated;
-
-    use Moose;
-
-    __PACKAGE__->meta->make_mutable;
-
-    around connect_info => sub {
-      my ($next, $self, $info) = @_;
-      $info->[3]{master_option} = 1;
-      $self->$next($info);
-    };
-
-    __PACKAGE__->meta->make_immutable;
-
-    no Moose;
-    }
-
-    ## --------------------------------------------------------------------- ##
     ## Subclass for when you are using SQLite for testing, this provides a fake
     ## replication support.
     ## --------------------------------------------------------------------- ##