move morse to seperate module

This commit is contained in:
Pim Kunis 2019-07-14 15:05:45 +02:00
parent b93d48920a
commit cbec08aae8
11 changed files with 98 additions and 12 deletions

View file

@ -1,5 +0,0 @@
defmodule Ui.SignalMorse do
def signal do
IO.puts("bleep bloop")
end
end

View file

@ -22,7 +22,7 @@ defmodule UiWeb.PageController do
case get_start_time() do
start_time when start_time + 35 <= now ->
System.put_env("MORSE_START_TIME", Integer.to_string(now))
Ui.SignalMorse.signal()
Morse.signal("...---...")
text(conn, "Done.")
_ ->
text(conn, "It is still in progress...")

View file

@ -38,7 +38,8 @@ defmodule Ui.MixProject do
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"}
{:plug_cowboy, "~> 2.0"},
{:morse, path: "../morse"}
]
end
end

View file

@ -1,8 +1,3 @@
defmodule UiWeb.PageControllerTest do
use UiWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, "/")
assert html_response(conn, 200) =~ "Welcome to Phoenix!"
end
end