From: Peter Rabbitson Date: Wed, 2 Oct 2013 06:42:48 +0000 (+0200) Subject: Proper fix for t/storage/replicated.t (augments 617474ab7e) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6287275c620da0668aa46d4f98b594ad219c4511;p=dbsrgits%2FDBIx-Class-Historic.git Proper fix for t/storage/replicated.t (augments 617474ab7e) Instead of blindly changing the use_ok to use figured out and moved together the pieces responsible for the dance in the 1st place --- diff --git a/t/storage/replicated.t b/t/storage/replicated.t index cadd085..dfd3870 100644 --- a/t/storage/replicated.t +++ b/t/storage/replicated.t @@ -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. ## --------------------------------------------------------------------- ##