Only load DBICTest::Schema when needed in tests
[dbsrgits/DBIx-Class.git] / t / 73oracle_blob.t
index ae5a359..e3b89b8 100644 (file)
@@ -9,7 +9,6 @@ use DBIx::Class::Optional::Dependencies ();
 
 use lib qw(t/lib);
 use DBICTest;
-use DBIC::SqlMakerTest;
 
 my ($dsn,  $user,  $pass)  = @ENV{map { "DBICTEST_ORA_${_}" }  qw/DSN USER PASS/};
 
@@ -24,7 +23,7 @@ $ENV{NLS_COMP} = "BINARY";
 $ENV{NLS_LANG} = "AMERICAN";
 
 my $v = do {
-  my $si = DBICTest::Schema->connect($dsn, $user, $pass)->storage->_server_info;
+  my $si = DBICTest->connect_schema($dsn, $user, $pass)->storage->_server_info;
   $si->{normalized_dbms_version}
     or die "Unparseable Oracle server version: $si->{dbms_version}\n";
 };
@@ -44,7 +43,7 @@ my $dbh;
 
 my $schema;
 for my $opt (@tryopt) {
-  my $schema = DBICTest::Schema->connect($dsn, $user, $pass, $opt);
+  my $schema = DBICTest->connect_schema($dsn, $user, $pass, $opt);
 
   $dbh = $schema->storage->dbh;
   my $q = $schema->storage->sql_maker->quote_char || '';
@@ -78,17 +77,12 @@ SKIP: {
               . ': https://rt.cpan.org/Ticket/Display.html?id=64206'
     if $q;
 
-  # so we can disable BLOB mega-output
-  my $orig_debug = $schema->storage->debug;
-
   my $id;
   foreach my $size (qw( small large )) {
     $id++;
 
-    local $schema->storage->{debug} = $size eq 'large'
-      ? 0
-      : $orig_debug
-    ;
+    local $schema->storage->{debug} = 0
+      if $size eq 'large';
 
     my $str = $binstr{$size};
     lives_ok {
@@ -154,8 +148,6 @@ SKIP: {
     @objs = $rs->search({ blob => "re-updated blob", clob => 're-updated clob' })->all;
     is @objs, 0, 'row deleted successfully';
   }
-
-  $schema->storage->debug ($orig_debug);
 }
 
   do_clean ($dbh);