X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F89dbicadmin.t;h=58b6c638e4a2b70abca420bb6a8731d21c97133d;hb=9c34993a245213636c321b22ce0ff2f18aaf8d9b;hp=154ddabe9d611f5bc8bdeca23a6592431e9020d1;hpb=1f2e0cb92887ffc9b01cfc2028f1fc8e11b55ab8;p=dbsrgits%2FDBIx-Class.git diff --git a/t/89dbicadmin.t b/t/89dbicadmin.t index 154ddab..58b6c63 100644 --- a/t/89dbicadmin.t +++ b/t/89dbicadmin.t @@ -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"}| ) );