Handle ResultSetManager deprecation warning in common tests
Dagfinn Ilmari Mannsåker [Wed, 16 Jul 2008 16:46:52 +0000 (16:46 +0000)]
Changes
t/lib/dbixcsl_common_tests.pm

diff --git a/Changes b/Changes
index fd475e3..082411c 100644 (file)
--- a/Changes
+++ b/Changes
@@ -8,6 +8,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader
           directory if the user didn't specify one
         - Fix Oracle constraint and auto-increment detection for non-owned schemas
           (RT #35732)
+       - Handle ResultSetManager deprecation warning in common tests
 
 0.04999_05 Mon Apr 14, 2008
         - Fix limiting table list to the specified schema for DB2
index 135d1a8..cd42be8 100644 (file)
@@ -109,17 +109,22 @@ sub setup_schema {
         };
 
         ok(!$@, "Loader initialization") or diag $@;
+
+       my $warn_count = 2;
+       $warn_count++ if grep /ResultSetManager/, @loader_warnings;
+
         if($self->{skip_rels}) {
             SKIP: {
-                is(scalar(@loader_warnings), 2, "No loader warnings")
+                is(scalar(@loader_warnings), $warn_count, "No loader warnings")
                     or diag @loader_warnings;
                 skip "No missing PK warnings without rels", 1;
             }
         }
         else {
-            is(scalar(@loader_warnings), 3, "Expected loader warning")
+           $warn_count++;
+            is(scalar(@loader_warnings), $warn_count, "Expected loader warning")
                 or diag @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,
                  "Missing PK warning");
         }
     }