Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / cdbi / 19-set_sql.t
index 7118e4a..41040af 100644 (file)
@@ -1,14 +1,7 @@
 use strict;
+use warnings;
 use Test::More;
 
-BEGIN {
-  eval "use DBIx::Class::CDBICompat;";
-  if ($@) {
-    plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required');
-  }
-  plan tests => 20;
-}
-
 use lib 't/cdbi/testlib';
 use Film;
 use Actor;
@@ -17,7 +10,7 @@ use Actor;
   my @cols = Film->columns('Essential');
   is_deeply \@cols, ['title'], "1 Column in essential";
   is +Film->transform_sql('__ESSENTIAL__'), 'title', '__ESSENTIAL__ expansion';
-  
+
   # This provides a more interesting test
   Film->columns(Essential => qw(title rating));
   is +Film->transform_sql('__ESSENTIAL__'), 'title, rating',
@@ -35,7 +28,7 @@ Film->set_sql(
   SELECT __ESSENTIAL__
   FROM   __TABLE__
   WHERE  __TABLE__.rating = 'PG'
-  ORDER BY title DESC 
+  ORDER BY title DESC
 }
 );
 
@@ -59,7 +52,7 @@ Film->set_sql(
   SELECT __ESSENTIAL__
   FROM   __TABLE__
   WHERE  rating = ?
-  ORDER BY title DESC 
+  ORDER BY title DESC
 }
 );
 
@@ -78,7 +71,7 @@ Film->set_sql(
             WHERE   __IDENTIFIER__
         }
     );
-    
+
     my $film = Film->retrieve_all->first;
     my @found = Film->search_by_id($film->id);
     is @found, 1;
@@ -91,11 +84,11 @@ Film->set_sql(
   Film->set_sql(
     namerate => qq{
     SELECT __ESSENTIAL(f)__
-    FROM   __TABLE(=f)__, __TABLE(Actor=a)__ 
-    WHERE  __JOIN(a f)__    
+    FROM   __TABLE(=f)__, __TABLE(Actor=a)__
+    WHERE  __JOIN(a f)__
     AND    a.name LIKE ?
     AND    f.rating = ?
-    ORDER BY title 
+    ORDER BY title
   }
   );
 
@@ -114,11 +107,11 @@ Film->set_sql(
   Film->set_sql(
     ratename => qq{
     SELECT __ESSENTIAL(f)__
-    FROM   __TABLE(=f)__, __TABLE(Actor=a)__ 
-    WHERE  __JOIN(f a)__    
+    FROM   __TABLE(=f)__, __TABLE(Actor=a)__
+    WHERE  __JOIN(f a)__
     AND    f.rating = ?
     AND    a.name LIKE ?
-    ORDER BY title 
+    ORDER BY title
   }
   );
 
@@ -128,3 +121,4 @@ Film->set_sql(
   is $apg[1]->title, "B", "and B";
 }
 
+done_testing;