Skip to content

Commit

Permalink
doc: show results in README example
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirschbaum committed Aug 15, 2023
1 parent 2bce1fc commit 315e08c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ end
## Usage

```elixir
ZaIdNumber.validate("12345")
iex> ZaIdNumber.validate("12345")
{:error, "Invalid ID Number format"}

iex> ZaIdNumber.validate("[valid id number]")
{:ok, %{
gender: :male | :female,
age: pos_integer(),
date_of_birth: Date.t(),
citizen_status: :born_citizen | :permanent_resident
}
}

```

## Development
Expand Down
2 changes: 1 addition & 1 deletion test/za_id_number_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule ZaIdNumberTest do
use ExUnit.Case
doctest ZaIdNumber

test "greets the world" do
test "invalid id number" do
assert ZaIdNumber.validate("1234") == {:error, "Invalid ID Number format"}
end
end

0 comments on commit 315e08c

Please sign in to comment.