Created
March 7, 2020 22:48
-
-
Save bettio/83cea97e48a722353cc4eafea30e8815 to your computer and use it in GitHub Desktop.
Elixir morse encoder example - step 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule EncoderTest do | |
use ExUnit.Case | |
alias MorseEncoder.Encoder | |
test "encode hello world" do | |
assert Encoder.morse_encode('HELLO') == '.... . .-.. .-.. --- ' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- @moduledoc """ | |
- Documentation for MorseEncoder. | |
- """ | |
- | |
- @doc """ | |
- Hello world. | |
- | |
- ## Examples | |
- | |
- iex> MorseEncoder.hello() | |
- :world | |
- | |
- """ | |
- def hello do | |
- :world | |
- end | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment