my $res = eval {
local $ENV{GIT_DIR};
- App::Rgit->new();
+ App::Rgit->new(
+ git => 't/bin/git',
+ );
};
is $@, '', "App::Rgit->new(): no root, no GIT_DIR: doesn't croak";
isa_ok $res,'App::Rgit','App::Rgit->new(): no root, no GIT_DIR: returns object';
$res = eval {
local $ENV{GIT_DIR} = Cwd::cwd;
- App::Rgit->new();
+ App::Rgit->new(
+ git => 't/bin/git',
+ );
};
is $@, '', "App::Rgit->new(): no root: doesn't croak";
isa_ok $res, 'App::Rgit', 'App::Rgit->new(): no root: returns object';
$res = eval {
App::Rgit->new(
root => $0,
+ git => 't/bin/git',
);
};
like $@, qr/Invalid root directory/, 'App::Rgit->new(): wrong root: croaks';