diff options
author | Eric Wong <normalperson@yhbt.net> | 2014-02-06 22:19:20 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2014-02-07 03:05:06 +0000 |
commit | 419f8eb672754cd99d6ec12a1f7af0d85ae70795 (patch) | |
tree | a1801cf48372768f86ef1cc1621538d0f483f8b3 /t/config.t | |
parent | 3f0cf5ba17204bc6ce9e3c1f197d6b4d66831eb8 (diff) | |
download | public-inbox-419f8eb672754cd99d6ec12a1f7af0d85ae70795.tar.gz |
We'll be using git config files after all...
Diffstat (limited to 't/config.t')
-rw-r--r-- | t/config.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/config.t b/t/config.t new file mode 100644 index 00000000..7dddd2e8 --- /dev/null +++ b/t/config.t @@ -0,0 +1,23 @@ +# Copyright (C) 2014, Eric Wong <normalperson@yhbt.net> and all contributors +# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt) +use strict; +use warnings; +use Test::More; +use PublicInbox::Config; +use File::Temp qw/tempdir/; +my $tmpdir = tempdir(CLEANUP => 1); + +{ + is(system(qw(git init --bare), $tmpdir), 0, "git init successful"); + { + local $ENV{GIT_DIR} = $tmpdir; + is(system(qw(git config foo.bar hihi)), 0, "set config"); + } + + my $tmp = PublicInbox::Config->dump("$tmpdir/config"); + + is("hihi", $tmp->{"foo.bar"}, "config read correctly"); + is("true", $tmp->{"core.bare"}, "used --bare repo"); +} + +done_testing(); |