Regenerated README and fixed tests for bootstrapped checkouts.
[catagits/Gitalist.git] / t / 02git_Repository.t
index 176651d..749ac12 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 qw/no_plan/;
 use Test::Exception;
 use Test::utf8;
@@ -8,19 +15,16 @@ use Encode qw/decode_utf8/;
 use Data::Dumper;
 
 BEGIN {
-    # Don't die on win32.
-    eval {
-      # Mocking to allow testing regardless of the user's locale
-      require I18N::Langinfo;
-      no warnings 'redefine';
-      *I18N::Langinfo::langinfo = sub($) {
+    # Mocking to allow testing regardless of the user's locale
+    require I18N::Langinfo;
+    no warnings 'redefine';
+    *I18N::Langinfo::langinfo = sub($) {
         return "UTF-8" if $_[0] == I18N::Langinfo::CODESET();
-      };
-      *CORE::GLOBAL::getpwuid = sub {
+    };
+    *CORE::GLOBAL::getpwuid = sub {
         wantarray
-         ? ("test", "x", "1000", "1000", "", "", "T\x{c3}\x{a9}st", "/home/test", "/bin/bash")
-          : "test";
-      };
+            ? ("test", "x", "1000", "1000", "", "", "T\x{c3}\x{a9}st", "/home/test", "/bin/bash")
+            : "test";
     };
 }
 
@@ -78,10 +82,7 @@ like($proj->head_hash('HEAD'), qr/^([0-9a-fA-F]{40})$/, 'head_hash');
     isa_ok($tree[0], 'Gitalist::Git::Object', 'tree element 0');
 }
 
-# Be win32 friendly. Poor poor win32.
-if($^O ne 'MSWin32') {
-  my $owner = $proj->owner;
-  is_flagged_utf8($owner, "Owner name is flagged as utf8");
-  is_sane_utf8($owner, "Owner name is not double-encoded");
-  is($owner, decode_utf8("T\x{c3}\x{a9}st"),  "Owner name is correct");
-}
+my $owner = $proj->owner;
+is_flagged_utf8($owner, "Owner name is flagged as utf8");
+is_sane_utf8($owner, "Owner name is not double-encoded");
+is($owner, decode_utf8("T\x{c3}\x{a9}st"),  "Owner name is correct");