]> Sergey Matveev's repositories - public-inbox.git/blob - t/config.t
7dddd2e8edd0ef9af37defad97be164aed76586b
[public-inbox.git] / t / config.t
1 # Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors
2 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
3 use strict;
4 use warnings;
5 use Test::More;
6 use PublicInbox::Config;
7 use File::Temp qw/tempdir/;
8 my $tmpdir = tempdir(CLEANUP => 1);
9
10 {
11         is(system(qw(git init --bare), $tmpdir), 0, "git init successful");
12         {
13                 local $ENV{GIT_DIR} = $tmpdir;
14                 is(system(qw(git config foo.bar hihi)), 0, "set config");
15         }
16
17         my $tmp = PublicInbox::Config->dump("$tmpdir/config");
18
19         is("hihi", $tmp->{"foo.bar"}, "config read correctly");
20         is("true", $tmp->{"core.bare"}, "used --bare repo");
21 }
22
23 done_testing();