X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Freplicated.t;h=9ecc7e8261e06b6efcb373b9a18baf960efda706;hb=aff5e9c14f7ad7453a4a2a7d04dc4e85fa0d661c;hp=8696ba2a08f3e9f55d3efde5c1a05af1311aaadf;hpb=5a8d5308a40f3958a17335fdc35afddce7d4ae31;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/replicated.t b/t/storage/replicated.t index 8696ba2..9ecc7e8 100644 --- a/t/storage/replicated.t +++ b/t/storage/replicated.t @@ -19,14 +19,12 @@ BEGIN { use Test::Moose; use Test::Exception; -use List::Util 'first'; use Scalar::Util 'reftype'; -use File::Spec; use Moose(); use MooseX::Types(); note "Using Moose version $Moose::VERSION and MooseX::Types version $MooseX::Types::VERSION"; -my $var_dir = quotemeta ( File::Spec->catdir(qw/t var/) ); +my $var_dir_re = qr{ t [\/\\] var [\/\\] }x; ## Add a connect_info option to test option merging. use DBIx::Class::Storage::DBI::Replicated; @@ -157,8 +155,8 @@ TESTSCHEMACLASSES: { $self->master_path( DBICTest->_sqlite_dbfilename ); $self->slave_paths([ - File::Spec->catfile(qw/t var DBIxClass_slave1.db/), - File::Spec->catfile(qw/t var DBIxClass_slave2.db/), + 't/var/DBIxClass_slave1.db', + 't/var/DBIxClass_slave2.db', ]); return $self; @@ -376,7 +374,7 @@ ok @replicant_names, "found replicant names @replicant_names"; ## Silence warning about not supporting the is_replicating method if using the ## sqlite dbs. $replicated->schema->storage->debugobj->silence(1) - if first { $_ =~ /$var_dir/ } @replicant_names; + if grep { $_ =~ $var_dir_re } @replicant_names; isa_ok $replicated->schema->storage->balancer->current_replicant => 'DBIx::Class::Storage::DBI'; @@ -424,7 +422,7 @@ $replicated->schema->storage->replicants->{$replicant_names[1]}->active(1); ## Silence warning about not supporting the is_replicating method if using the ## sqlite dbs. $replicated->schema->storage->debugobj->silence(1) - if first { $_ =~ /$var_dir/ } @replicant_names; + if grep { $_ =~ $var_dir_re } @replicant_names; $replicated->schema->storage->pool->validate_replicants; @@ -607,7 +605,7 @@ $replicated->schema->storage->replicants->{$replicant_names[1]}->active(1); ## Silence warning about not supporting the is_replicating method if using the ## sqlite dbs. $replicated->schema->storage->debugobj->silence(1) - if first { $_ =~ /$var_dir/ } @replicant_names; + if grep { $_ =~ $var_dir_re } @replicant_names; $replicated->schema->storage->pool->validate_replicants;