Backport r4582 from branches/current:
Dagfinn Ilmari Mannsåker [Thu, 23 Apr 2009 13:03:45 +0000 (13:03 +0000)]
Handle ResultSetManager deprecation warning in common tests

Changes
t/lib/dbixcsl_common_tests.pm

diff --git a/Changes b/Changes
index eb010bb..92ee58b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader
 0.04006 Not Yet Released
         - Fix Oracle constraint detection for non-owned schemas (RT #35732)
         - Add result_base_class and schema_base_class options (RT #43977)
+        - Handle ResultSetManager deprecation warning in common tests
 
 0.04005 Sat Apr 05, 2008
         - Fix DB2 support
index 75d6090..ada0338 100644 (file)
@@ -85,17 +85,22 @@ sub run_tests {
             __PACKAGE__->connection(\@connect_info);
         };
         ok(!$@, "Loader initialization") or diag $@;
+
+        my $warn_count = 0;
+        $warn_count++ if grep /ResultSetManager/, @loader_warnings;
+
         if($self->{skip_rels}) {
-            is(scalar(@loader_warnings), 0)
+            is(scalar(@loader_warnings), $warn_count)
               or diag "Did not get the expected 0 warnings.  Warnings are: "
                 . join('',@loader_warnings);
             ok(1);
         }
         else {
-            is(scalar(@loader_warnings), 1)
+            $warn_count++;
+            is(scalar(@loader_warnings), $warn_count)
               or diag "Did not get the expected 1 warning.  Warnings are: "
                 . join('',@loader_warnings);
-            like($loader_warnings[0], qr/loader_test9 has no primary key/i);
+            is(grep(/loader_test9 has no primary key/, @loader_warnings), 1);
         }
     }