From: Peter Rabbitson <ribasushi@cpan.org>
Date: Sun, 5 Jul 2015 17:52:33 +0000 (+0200)
Subject: (travis) Silencer changes in f8200928 were practically undone by 8b60b921
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=519c48658c07eaf91a73d18f07343161b5f419c0;p=dbsrgits%2FDBIx-Class-Historic.git

(travis) Silencer changes in f8200928 were practically undone by 8b60b921
---

diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm
index 39a8af9..229859d 100644
--- a/t/lib/DBICTest.pm
+++ b/t/lib/DBICTest.pm
@@ -13,6 +13,7 @@ use Path::Class::File ();
 use File::Spec;
 use Fcntl qw/:DEFAULT :flock/;
 use Config;
+use Scope::Guard ();
 
 =head1 NAME
 
@@ -386,8 +387,11 @@ sub deploy_schema {
     my $schema = shift;
     my $args = shift || {};
 
-    local $schema->storage->{debug}
-      if ($ENV{TRAVIS}||'') eq 'true';
+    my $guard;
+    if ( ($ENV{TRAVIS}||'') eq 'true' and my $old_dbg = $schema->storage->debug ) {
+      $guard = Scope::Guard->new(sub { $schema->storage->debug($old_dbg) });
+      $schema->storage->debug(0);
+    }
 
     if ($ENV{"DBICTEST_SQLT_DEPLOY"}) {
         $schema->deploy($args);
@@ -417,8 +421,11 @@ sub populate_schema {
     my $self = shift;
     my $schema = shift;
 
-    local $schema->storage->{debug}
-      if ($ENV{TRAVIS}||'') eq 'true';
+    my $guard;
+    if ( ($ENV{TRAVIS}||'') eq 'true' and my $old_dbg = $schema->storage->debug ) {
+      $guard = Scope::Guard->new(sub { $schema->storage->debug($old_dbg) });
+      $schema->storage->debug(0);
+    }
 
     $schema->populate('Genre', [
       [qw/genreid name/],