-# vim: filetype=perl
+# vim: filetype=perl et ts=2
use strict;
use warnings;
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) };
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"}| ) );