summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-10-13 10:38:43 -0400
committerFred Hebert <mononcqc@ferd.ca>2017-10-13 10:38:43 -0400
commite592573745ee5dbc337d77997aaa8ebb40b566bb (patch)
treedcc027ab85f9acea70738145951670e453ebe6c8
parent73fc54235f6b3cec5201e23c7baee4c5086ac2b1 (diff)
Add tests for unlock state passthrough
-rw-r--r--test/rebar_unlock_SUITE.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/rebar_unlock_SUITE.erl b/test/rebar_unlock_SUITE.erl
index 8dbdb3a..b2c0205 100644
--- a/test/rebar_unlock_SUITE.erl
+++ b/test/rebar_unlock_SUITE.erl
@@ -42,8 +42,10 @@ unlock(Config) ->
Locks = read_locks(Config),
rebar_test_utils:run_and_check(Config, [], ["unlock", "fakeapp"], {ok, []}),
Locks = read_locks(Config),
- rebar_test_utils:run_and_check(Config, [], ["unlock", "uuid"], {ok, []}),
+ {ok, State} = rebar_test_utils:run_and_check(Config, [], ["unlock", "uuid"], return),
?assertEqual(Locks -- ["uuid"], read_locks(Config)),
+ ?assert(false =:= lists:keyfind(<<"uuid">>, 1, rebar_state:get(State, {locks, default}))),
+ ?assert(false =/= lists:keyfind(<<"itc">>, 1, rebar_state:get(State, {locks, default}))),
rebar_test_utils:run_and_check(Config, [], ["unlock", "gproc,itc"], {ok, []}),
?assertEqual(Locks -- ["uuid","gproc","itc"], read_locks(Config)),
rebar_test_utils:run_and_check(Config, [], ["unlock", string:join(Locks,",")], {ok, []}),
@@ -52,8 +54,9 @@ unlock(Config) ->
unlock_all(Config) ->
[_|_] = read_locks(Config),
- rebar_test_utils:run_and_check(Config, [], ["unlock"], {ok, []}),
+ {ok, State} = rebar_test_utils:run_and_check(Config, [], ["unlock"], return),
?assertEqual({error, enoent}, read_locks(Config)),
+ ?assertEqual([], rebar_state:get(State, {locks, default})),
ok.
read_locks(Config) ->