Extract couple more stateless functions from DBIHacks (like 497d0451)
[dbsrgits/DBIx-Class.git] / t / sqlmaker / oracle.t
index 14e74e2..0fef7fb 100644 (file)
@@ -1,21 +1,18 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'id_shortener';
+
 use strict;
 use warnings;
-use Test::More;
-
-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 Test::More;
 use Test::Exception;
-use Data::Dumper::Concise;
-use lib qw(t/lib);
-use DBIC::SqlMakerTest;
+
+use DBIx::Class::_Util 'dump_value';
+use DBICTest ':DiffSQL';
 use DBIx::Class::SQLMaker::Oracle;
 
 #
-#  Offline test for connect_by 
+#  Offline test for connect_by
 #  ( without active database connection)
 #
 my @handle_tests = (
@@ -43,7 +40,7 @@ my @handle_tests = (
         bind        => ['King'],
         msg         => 'oracle.com example #1',
     },
-    # CONNECT BY PRIOR employee_id = manager_id and 
+    # CONNECT BY PRIOR employee_id = manager_id and
     #            PRIOR account_mgr_id = customer_id ...
     {
         connect_by  => {
@@ -71,7 +68,7 @@ for my $case (@handle_tests) {
         sub {
             ( $stmt, @bind ) = $sqla_oracle->_recurse_where( $case->{connect_by} );
             is_same_sql_bind( $stmt, \@bind, $case->{stmt}, $case->{bind},$msg )
-              || diag "Search term:\n" . Dumper $case->{connect_by};
+              || diag "Search term:\n" . dump_value $case->{connect_by};
         }
     ,sprintf("lives is ok from '%s'",$msg));
 }