added tests
This commit is contained in:
parent
e77e530f65
commit
8922bd84a2
2 changed files with 13 additions and 1 deletions
|
|
@ -98,7 +98,6 @@ defmodule Pinchflat.Boot.PreJobStartupTasks do
|
|||
Settings.set(apprise_version: apprise_version)
|
||||
end
|
||||
|
||||
# TODO: test
|
||||
defp run_app_init_script do
|
||||
runner = Application.get_env(:pinchflat, :user_script_runner, UserScriptRunner)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ defmodule Pinchflat.Boot.PreJobStartupTasksTest do
|
|||
setup do
|
||||
stub(YtDlpRunnerMock, :version, fn -> {:ok, "1"} end)
|
||||
stub(AppriseRunnerMock, :version, fn -> {:ok, "2"} end)
|
||||
stub(UserScriptRunnerMock, :run, fn _event_type, _data -> {:ok, "3", 0} end)
|
||||
|
||||
:ok
|
||||
end
|
||||
|
|
@ -112,4 +113,16 @@ defmodule Pinchflat.Boot.PreJobStartupTasksTest do
|
|||
assert Settings.get!(:apprise_version)
|
||||
end
|
||||
end
|
||||
|
||||
describe "run_app_init_script" do
|
||||
test "calls the app_init user script runner" do
|
||||
expect(UserScriptRunnerMock, :run, fn :app_init, data ->
|
||||
assert data == %{}
|
||||
|
||||
{:ok, "", 0}
|
||||
end)
|
||||
|
||||
PreJobStartupTasks.init(%{})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue