6 plan skip_all, 'Install JSON to run this test' if ($@);
8 eval 'require Text::CSV_XS';
10 eval 'require Text::CSV_PP';
11 plan skip_all, 'Install Text::CSV_XS or Text::CSV_PP to run this test' if ($@);
17 my $employees = $schema->resultset('Employee');
18 my $cmd = qq|script/dbicadmin --schema=DBICTest::Schema --class=Employee --tlibs --connect='["dbi:SQLite:dbname=t/var/DBIxClass.db","",""]' --force --tlibs|;
20 `$cmd --op=insert --set='{name:"Matt"}'`;
21 ok( ($employees->count()==1), 'insert count' );
23 my $employee = $employees->find(1);
24 ok( ($employee->name() eq 'Matt'), 'insert valid' );
26 `$cmd --op=update --set='{name:"Trout"}'`;
27 $employee = $employees->find(1);
28 ok( ($employee->name() eq 'Trout'), 'update' );
30 `$cmd --op=insert --set='{name:"Aran"}'`;
31 my $data = `$cmd --op=select --attrs='{order_by:"name"}'`;
32 ok( ($data=~/Aran.*Trout/s), 'select with attrs' );
34 `$cmd --op=delete --where='{name:"Trout"}'`;
35 ok( ($employees->count()==1), 'delete' );