X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg_bytea.t;h=7049b319cf8e3c8895f22df497e7e6ce285ba1c1;hb=74919a00766bc8f9bd9f6170d1977e186ce676d5;hp=bf577a9769f40cdaeae4c71f072a40025c7a64d0;hpb=0dd1b7362ff4b104d68946ae6ca8e7e483621381;p=dbsrgits%2FDBIx-Class.git diff --git a/t/72pg_bytea.t b/t/72pg_bytea.t index bf577a9..7049b31 100644 --- a/t/72pg_bytea.t +++ b/t/72pg_bytea.t @@ -1,10 +1,11 @@ -use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_pg'; +use DBIx::Class::Optional::Dependencies -skip_all_without => qw(test_rdbms_pg binary_data); use strict; use warnings; use Test::More; -use Try::Tiny; +use DBIx::Class::_Util 'modver_gt_or_eq'; + use lib qw(t/lib); use DBICTest; @@ -12,16 +13,11 @@ my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/} my $schema = DBICTest::Schema->connect($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); -if ($schema->storage->_server_info->{normalized_dbms_version} >= 9.0) { - if (not try { DBD::Pg->VERSION('2.17.2') }) { - plan skip_all => - 'DBD::Pg < 2.17.2 does not work with Pg >= 9.0 BYTEA columns'; - } -} -elsif (not try { DBD::Pg->VERSION('2.9.2') }) { - plan skip_all => - 'DBD::Pg < 2.9.2 does not work with BYTEA columns'; -} +plan skip_all => 'DBD::Pg < 2.17.2 does not work with Pg >= 9.0 BYTEA columns' if ( + ! modver_gt_or_eq('DBD::Pg', '2.17.2') + and + $schema->storage->_server_info->{normalized_dbms_version} >= 9.0 +); my $dbh = $schema->storage->dbh;