use Test::More;
use Config;
use lib qw(t/lib);
-$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
use DBICTest;
-
BEGIN {
require DBIx::Class;
plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin_script')
unless DBIx::Class::Optional::Dependencies->req_ok_for('admin_script');
}
+$ENV{PATH} = '';
+$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
+
my @json_backends = qw/XS JSON DWIW/;
# test the script is setting @INC properly
SKIP: {
skip ("MSWin32 doesn't support -| either", 1) if $^O eq 'MSWin32';
- open(my $fh, "-|", ( $^X, 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!;
+ my ($perl) = $^X =~ /(.*)/;
+
+ open(my $fh, "-|", ( $perl, 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!;
my $data = do { local $/; <$fh> };
close($fh);
if (!ok( ($data=~/Aran.*Trout/s), "$ENV{JSON_ANY_ORDER}: select with attrs" )) {
}
sub default_args {
+ my $dbname = DBICTest->_sqlite_dbfilename;
return (
qw|--quiet --schema=DBICTest::Schema --class=Employee|,
- q|--connect=["dbi:SQLite:dbname=t/var/DBIxClass.db","","",{"AutoCommit":1}]|,
+ qq|--connect=["dbi:SQLite:dbname=$dbname","","",{"AutoCommit":1}]|,
qw|--force -I testincludenoniterference|,
);
}
# calls it. Bleh.
#
sub test_exec {
- my $perl = $^X;
+ my ($perl) = $^X =~ /(.*)/;
my @args = ('script/dbicadmin', @_);