Further tradeoffs on relationship sanity checking (augments 9e7525a2)
[dbsrgits/DBIx-Class.git] / t / sqlmaker / order_by_bindtransport.t
index 095f72d..b612375 100644 (file)
@@ -8,13 +8,8 @@ use lib qw(t/lib);
 use DBICTest;
 use DBIC::SqlMakerTest;
 
-my $schema = DBICTest->init_schema;
-
-my $rs = $schema->resultset('FourKeys');
-
 sub test_order {
-
-  TODO: {
+    my $rs = shift;
     my $args = shift;
 
     local $TODO = "Not implemented" if $args->{todo};
@@ -30,9 +25,9 @@ sub test_order {
             }
           )->as_query,
         "(
-          SELECT me.foo, me.bar, me.hello, me.goodbye, me.sensors, me.read_count 
-          FROM fourkeys me 
-          WHERE ( foo = ? ) 
+          SELECT me.foo, me.bar, me.hello, me.goodbye, me.sensors, me.read_count
+          FROM fourkeys me
+          WHERE ( foo = ? )
           HAVING read_count > ? OR read_count < ?
           ORDER BY $args->{order_req}
         )",
@@ -49,7 +44,6 @@ sub test_order {
         ],
       ) || diag Dumper $args->{order_by};
     };
-  }
 }
 
 my @tests = (
@@ -100,6 +94,7 @@ my @tests = (
     },
 );
 
-test_order($_) for @tests;
+my $rs = DBICTest->init_schema->resultset('FourKeys');
+test_order($rs, $_) for @tests;
 
 done_testing;