Skip to content

Instantly share code, notes, and snippets.

@eviltofu
Created February 23, 2020 08:54
Show Gist options
  • Save eviltofu/dc60d220ffab19523d98d49555d50997 to your computer and use it in GitHub Desktop.
Save eviltofu/dc60d220ffab19523d98d49555d50997 to your computer and use it in GitHub Desktop.
defmodule WorkTest do
use ExUnit.Case
doctest Work
test "face_card?" do
assert Work.face_card?(1)
for card_value <- 2..9 do
refute Work.face_card?(card_value)
end
assert Work.face_card?(10)
assert Work.face_card?(11)
assert Work.face_card?(12)
assert Work.face_card?(13)
end
describe "testig all face card? function" do
test "all face cards" do
assert Work.all_face_cards?([1, 10, 11, 12, 13])
end
test "all non face cards" do
refute Work.all_face_cards?([2, 3, 4, 5, 6, 7, 8, 9])
end
test "mixed cards" do
refute Work.all_face_cards?([1, 2])
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment