Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylane committed Oct 7, 2024
1 parent 564f9c3 commit 9490581
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/rebar3_grisp_io_deploy_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ run_deploy(Config) ->
setup_meck_io() ->
ok = meck:new(rebar3_grisp_io_io, [no_link]),
ok = meck:expect(rebar3_grisp_io_io, ask, fun fake_ask/2),
ok = meck:expect(rebar3_grisp_io_io, console, fun (_, _) -> ok end),
ok = meck:expect(rebar3_grisp_io_io, abort, 2, fun (_, [E, S]) -> ct:pal(error, "Error Stack: ~p", [S]), ct:fail("Fail: ~p", [E]) end),
ok = meck:expect(rebar3_grisp_io_io, abort, 1,
fun(Msg) ->
Expand All @@ -87,7 +88,7 @@ setup_meck_io() ->

setup_meck_gio_utils() ->
ok = meck:new(rebar3_grisp_io_utils, [no_link, passthrough]),
ok = meck:expect(rebar3_grisp_io_utils, grisp_pack, fun(RState, _) -> {ok, RState} end).
ok = meck:expect(rebar3_grisp_io_utils, grisp_pack, fun(RState, _, _) -> {ok, RState} end).

fake_ask("Local password", _) ->
<<"azerty">>.
3 changes: 2 additions & 1 deletion test/rebar3_grisp_io_upload_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ run_upload(Config) ->
setup_meck_io() ->
ok = meck:new(rebar3_grisp_io_io, [no_link]),
ok = meck:expect(rebar3_grisp_io_io, ask, fun fake_ask/2),
ok = meck:expect(rebar3_grisp_io_io, console, fun (_, _) -> ok end),
ok = meck:expect(rebar3_grisp_io_io, abort, 2, fun (_, [E, S]) -> ct:pal(error, "Error Stack: ~p", [S]), ct:fail("Fail: ~p", [E]) end),
ok = meck:expect(rebar3_grisp_io_io, abort, 1, fun (Msg) ->
ct:fail(Msg)
Expand All @@ -72,7 +73,7 @@ setup_meck_io() ->

setup_meck_gio_utils() ->
ok = meck:new(rebar3_grisp_io_utils, [no_link, passthrough]),
ok = meck:expect(rebar3_grisp_io_utils, grisp_pack, fun(RState, _) -> {ok, RState} end).
ok = meck:expect(rebar3_grisp_io_utils, grisp_pack, fun(RState, _, _) -> {ok, RState} end).

fake_ask("Local password", _) ->
<<"azerty">>.
3 changes: 2 additions & 1 deletion test/rebar3_grisp_io_validate_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ run_validate(Config) ->
setup_meck_io() ->
ok = meck:new(rebar3_grisp_io_io, [no_link]),
ok = meck:expect(rebar3_grisp_io_io, ask, fun fake_ask/2),
ok = meck:expect(rebar3_grisp_io_io, console, fun (_, _) -> ok end),
ok = meck:expect(rebar3_grisp_io_io, abort, 2, fun (_, [E, S]) -> ct:pal(error, "Error Stack: ~p", [S]), ct:fail("Fail: ~p", [E]) end),
ok = meck:expect(rebar3_grisp_io_io, abort, 1,
fun(Msg) ->
Expand All @@ -86,7 +87,7 @@ setup_meck_io() ->

setup_meck_gio_utils() ->
ok = meck:new(rebar3_grisp_io_utils, [no_link, passthrough]),
ok = meck:expect(rebar3_grisp_io_utils, grisp_pack, fun(RState, _) -> {ok, RState} end).
ok = meck:expect(rebar3_grisp_io_utils, grisp_pack, fun(RState, _, _) -> {ok, RState} end).

fake_ask("Local password", _) ->
<<"azerty">>.

0 comments on commit 9490581

Please sign in to comment.