This commit is contained in:
2024-03-11 11:30:10 -04:00
parent 4265743d75
commit d46a9b8e9a
10 changed files with 261 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
ExUnit.start()
ExUnit.configure(exclude: :pending, trace: true)

View File

@@ -0,0 +1,38 @@
defmodule TwoFerTest do
use ExUnit.Case
test "no name given" do
assert TwoFer.two_fer() == "One for you, one for me."
end
# @tag :pending
test "a name given" do
assert TwoFer.two_fer("Alice") == "One for Alice, one for me."
end
# @tag :pending
test "another name given" do
assert TwoFer.two_fer("Bob") == "One for Bob, one for me."
end
# @tag :pending
test "when the argument is a number" do
assert_raise FunctionClauseError, fn ->
TwoFer.two_fer(10)
end
end
# @tag :pending
test "when the argument is an atom" do
assert_raise FunctionClauseError, fn ->
TwoFer.two_fer(:bob)
end
end
# @tag :pending
test "when the argument is a charlist" do
assert_raise FunctionClauseError, fn ->
refute TwoFer.two_fer(~c"Jon Snow")
end
end
end