Merge branch 'master' into topic/constructor_rewrite
[dbsrgits/DBIx-Class.git] / t / sqlmaker / oraclejoin.t
similarity index 75%
rename from t/41orrible.t
rename to t/sqlmaker/oraclejoin.t
index b0117a7..3ba82ab 100644 (file)
@@ -2,34 +2,19 @@ use strict;
 use warnings;
 
 use Test::More;
-use DBIx::Class::SQLAHacks::OracleJoins;
+
+BEGIN {
+  require DBIx::Class::Optional::Dependencies;
+  plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('id_shortener')
+    unless DBIx::Class::Optional::Dependencies->req_ok_for ('id_shortener');
+}
 
 use lib qw(t/lib);
-use DBICTest; # do not remove even though it is not used
+use DBICTest;
+use DBIx::Class::SQLMaker::OracleJoins;
 use DBIC::SqlMakerTest;
 
-plan tests => 4;
-
-my $sa = new DBIx::Class::SQLAHacks::OracleJoins;
-
-$sa->limit_dialect('RowNum');
-
-is($sa->select('rubbish',
-                  [ 'foo.id', 'bar.id', \'TO_CHAR(foo.womble, "blah")' ],
-                  undef, undef, 1, 3),
-   'SELECT * FROM
-(
-    SELECT A.*, ROWNUM r FROM
-    (
-        SELECT foo.id AS col1, bar.id AS col2, TO_CHAR(foo.womble, "blah") AS col3 FROM rubbish 
-    ) A
-    WHERE ROWNUM < 5
-) B
-WHERE r >= 4
-', 'Munged stuff to make Oracle not explode');
-
-# test WhereJoins
-# search with undefined or empty $cond
+my $sa = DBIx::Class::SQLMaker::OracleJoins->new;
 
 #  my ($self, $table, $fields, $where, $order, @rest) = @_;
 my ($sql, @bind) = $sa->select(
@@ -86,4 +71,5 @@ is_same_sql_bind(
   'WhereJoins search with or in where clause'
 );
 
+done_testing;