change white space to not be tabs
[dbsrgits/DBIx-Class.git] / t / 89dbicadmin.t
index 154ddab..58b6c63 100644 (file)
@@ -1,4 +1,4 @@
-# vim: filetype=perl
+# vim: filetype=perl et ts=2
 use strict;
 use warnings;  
 
@@ -7,21 +7,27 @@ use lib qw(t/lib);
 use DBICTest;
 
 
-eval 'require JSON::Any';
-plan skip_all => 'Install JSON::Any to run this test' if ($@);
+BEGIN {
+    eval "require DBIx::Class::Admin";
+    plan skip_all => "Deps not installed: $@" if $@;
 
-eval 'require Text::CSV_XS';
-if ($@) {
-    eval 'require Text::CSV_PP';
-    plan skip_all => 'Install Text::CSV_XS or Text::CSV_PP to run this test' if ($@);
-}
+    eval "require Getopt::Long::Descriptive";
+    plan skip_all => 'Install Getopt::Long::Descriptive to run this test' if ($@);
+
+    eval 'require JSON::Any';
+    plan skip_all => 'Install JSON::Any to run this test' if ($@);
 
-my @json_backends = qw/XS JSON DWIW Syck/;
+    eval 'require Text::CSV_XS';
+    if ($@) {
+        eval 'require Text::CSV_PP';
+        plan skip_all => 'Install Text::CSV_XS or Text::CSV_PP to run this test' if ($@);
+    }
+}
+my @json_backends = qw/XS JSON DWIW/;
 my $tests_per_run = 5;
 
 plan tests => $tests_per_run * @json_backends;
 
-use JSON::Any;
 for my $js (@json_backends) {
 
     eval {JSON::Any->import ($js) };
@@ -57,7 +63,9 @@ sub test_dbicadmin {
         open(my $fh, "-|",  _prepare_system_args( qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!;
         my $data = do { local $/; <$fh> };
         close($fh);
-        ok( ($data=~/Aran.*Trout/s), "$ENV{JSON_ANY_ORDER}: select with attrs" );
+        if (!ok( ($data=~/Aran.*Trout/s), "$ENV{JSON_ANY_ORDER}: select with attrs" )) {
+            diag ("data from select is $data")
+        };
     }
 
     system( _prepare_system_args( qw|--op=delete --where={"name":"Trout"}| ) );