Skip to content

Commit

Permalink
t/11-create.t: fix path tests under Win32
Browse files Browse the repository at this point in the history
  • Loading branch information
book committed Oct 23, 2010
1 parent 3652f64 commit 9d68213
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions t/11-create.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use Test::More;
use File::Temp qw( tempdir ); use File::Temp qw( tempdir );
use File::Spec; use File::Spec;
use File::Path; use File::Path;
use Cwd qw( cwd abs_path ); use Cwd qw( cwd realpath );
use Git::Repository; use Git::Repository;


plan skip_all => 'Default git binary not found in PATH' plan skip_all => 'Default git binary not found in PATH'
Expand All @@ -21,7 +21,7 @@ delete @ENV{qw( GIT_DIR GIT_WORK_TREE )};
my $home = cwd(); my $home = cwd();


# a place to put a git repository # a place to put a git repository
my $tmp = abs_path( tempdir( CLEANUP => 1 ) ); my $tmp = realpath( tempdir( CLEANUP => 1 ) );


# some dirname generating routine # some dirname generating routine
my $i; my $i;
Expand All @@ -31,6 +31,10 @@ sub next_dir { return File::Spec->catdir( $tmp, ++$i ); }
sub test_repo { sub test_repo {
my ( $r, $gitdir, $dir, $options ) = @_; my ( $r, $gitdir, $dir, $options ) = @_;


# normalize under Win32, but do not die
eval { $gitdir = realpath($gitdir) };
eval { $dir = realpath($dir) };

local $Test::Builder::Level = $Test::Builder::Level + 1; local $Test::Builder::Level = $Test::Builder::Level + 1;
isa_ok( $r, 'Git::Repository' ); isa_ok( $r, 'Git::Repository' );
is( $r->git_dir, $gitdir, '... correct git_dir' ); is( $r->git_dir, $gitdir, '... correct git_dir' );
Expand Down

0 comments on commit 9d68213

Please sign in to comment.