Win32 can have git binaries with extensions, and non-/ path separators
[catagits/Gitalist.git] / t / 02git_util.t
index 94f82f7..428677d 100644 (file)
@@ -1,6 +1,13 @@
+use FindBin qw/$Bin/;
+BEGIN {
+    my $env = "$FindBin::Bin/../script/env";
+    if (-r $env) {
+        do $env or die $@;
+    }
+}
+
 use strict;
 use warnings;
-use FindBin qw/$Bin/;
 use Test::More;
 
 use Data::Dumper;
@@ -19,7 +26,7 @@ my $util = Gitalist::Git::Util->new(
 );
 isa_ok($util, 'Gitalist::Git::Util');
 
-like( $util->_git, qr#/git$#, 'git binary found');
+like( $util->_git, qr#\bgit(\.\w+)*$#, 'git binary found');
 isa_ok($util->gpp, 'Git::PurePerl', 'gpp instance created');
 
 done_testing;