config: test for setting and getting bool
This commit is contained in:
22
test/config_test.erl
Normal file
22
test/config_test.erl
Normal file
@@ -0,0 +1,22 @@
|
||||
-module(config_test).
|
||||
-compile([export_all]).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include("src/geef_records.hrl").
|
||||
|
||||
config_test() ->
|
||||
{foreach, fun start/0, fun stop/1, [fun bool_test/1]}.
|
||||
|
||||
start() ->
|
||||
{A, B, C} = now(),
|
||||
N = node(),
|
||||
TmpFile = io_lib:format("/tmp/geef-~p~p~p~p.gitconfig", [N, A, B, C]),
|
||||
{ok, Config} = geef_config:open(TmpFile),
|
||||
{Config, TmpFile}.
|
||||
|
||||
bool_test({Config, _}) ->
|
||||
Var = "core.logallrefupdates",
|
||||
ok = geef_config:set(Config, Var, true),
|
||||
[?_assertEqual({ok, true}, geef_config:get_bool(Config, Var))].
|
||||
|
||||
stop({_, Path}) ->
|
||||
ok = file:delete(Path).
|
||||
Reference in New Issue
Block a user