X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F747mssql_ado.t;h=d40cd17b079612542c7bef59c06e1b53ce447fb5;hb=63ee8b7896e02ee888eb26251fc28311721832c5;hp=77a88dc4f062c995602c765a3fde6277b25d3cd5;hpb=2edf33525bc7be0824693925c528791d84db98aa;p=dbsrgits%2FDBIx-Class.git diff --git a/t/747mssql_ado.t b/t/747mssql_ado.t index 77a88dc..d40cd17 100644 --- a/t/747mssql_ado.t +++ b/t/747mssql_ado.t @@ -1,24 +1,19 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } +use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_mssql_ado'; + use strict; use warnings; use Test::More; use Test::Exception; use Try::Tiny; -use DBIx::Class::Optional::Dependencies (); -use lib qw(t/lib); -use DBICTest; -plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mssql_ado') - unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mssql_ado'); +use DBICTest; # Example DSN (from frew): # dbi:ADO:PROVIDER=sqlncli10;SERVER=tcp:172.24.2.10;MARS Connection=True;Initial Catalog=CIS;UID=cis_web;PWD=...;DataTypeCompatibility=80; - my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ADO_${_}" } qw/DSN USER PASS/}; -plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ADO_DSN}, _USER and _PASS to run this test' - unless ($dsn && $user); - DBICTest::Schema->load_classes(qw/VaryingMAX ArtistGUID/); my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) ); @@ -223,9 +218,7 @@ is $row->artistid, $current_artistid+1, my $rs = $schema->resultset('VaryingMAX'); foreach my $size (qw/small large/) { - my $orig_debug = $schema->storage->debug; - - $schema->storage->debug(0) if $size eq 'large'; + local $schema->storage->{debug} = 0 if $size eq 'large'; my $str = $binstr{$size}; my $row; @@ -242,8 +235,6 @@ foreach my $size (qw/small large/) { cmp_ok try { $row->varchar_max }, 'eq', $str, 'VARCHAR(MAX) matches'; cmp_ok try { $row->nvarchar_max }, 'eq', $str, 'NVARCHAR(MAX) matches'; cmp_ok try { $row->varbinary_max }, 'eq', $str, 'VARBINARY(MAX) matches'; - - $schema->storage->debug($orig_debug); } # test regular blobs