Make maybe_plan insufficent-version-aware
[dbsrgits/SQL-Translator.git] / lib / Test / SQL / Translator.pm
index 2cbf82a..4d0eab9 100644 (file)
@@ -466,12 +466,17 @@ sub maybe_plan {
 
     for my $module (@modules) {
         eval "use $module;";
-        if ($@ && $@ =~ /Can't locate (\S+)/) {
+        next if !$@;
+
+        if ($@ =~ /Can't locate (\S+)/) {
             my $mod = $1;
             $mod =~ s/\.pm$//;
             $mod =~ s#/#::#g;
             push @errors, $mod;
         }
+        elsif ($@ =~ /([\w\:]+ version [\d\.]+) required.+?this is only version/) {
+            push @errors, $1;
+        }
     }
 
     if (@errors) {