-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: 1. Adds more tests 2. Fixes credo issues
- Loading branch information
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
defmodule PetrovichTest.DetectorTest do | ||
use ExUnit.Case | ||
|
||
alias Petrovich.Detector | ||
|
||
test "detects exception genders" do | ||
assert Detector.detect_gender("Никита", :firstname) == {:ok, "male"} | ||
assert Detector.detect_gender("Женя", :firstname) == {:ok, "androgynous"} | ||
assert Detector.detect_gender("Наташа", :firstname) == {:ok, "female"} | ||
end | ||
|
||
test "detects correct gender" do | ||
assert Detector.detect_gender("Айгуль", :firstname) == {:ok, "female"} | ||
assert Detector.detect_gender("Ибрагим", :firstname) == {:ok, "male"} | ||
end | ||
end |