This commit is contained in:
Sloane Perrault 2023-07-02 08:20:19 -04:00
parent db5e754d86
commit 5bf8b50e2d
No known key found for this signature in database
3 changed files with 8 additions and 7 deletions

View file

@ -153,7 +153,7 @@ defmodule TypeID do
[suffix] ->
from!("", suffix)
_ ->
_ ->
raise ArgumentError, "invalid TypeID"
end
end

View file

@ -4,7 +4,7 @@ defmodule TypeID.MixProject do
def project do
[
app: :typeid_elixir,
version: "0.0.1",
version: "0.1.0",
elixir: "~> 1.15",
start_permanent: Mix.env() == :prod,
description: description(),

View file

@ -1,16 +1,17 @@
defmodule TypeID.SpecTest do
use ExUnit.Case
specs_path = :code.priv_dir(:typeid_elixir)
|> Path.join("/spec")
specs_path =
:code.priv_dir(:typeid_elixir)
|> Path.join("/spec")
@valid_specs specs_path
|> Path.join("/valid.yml")
|> YamlElixir.read_from_file!()
@invalid_specs specs_path
|> Path.join("/invalid.yml")
|> YamlElixir.read_from_file!()
|> Path.join("/invalid.yml")
|> YamlElixir.read_from_file!()
describe "valid" do
for %{"name" => name, "typeid" => typeid, "prefix" => prefix, "uuid" => uuid} <- @valid_specs do
@ -23,7 +24,7 @@ defmodule TypeID.SpecTest do
end
describe "invalid" do
for %{"name" => name, "typeid" => typeid, "description" => desc } <- @invalid_specs do
for %{"name" => name, "typeid" => typeid, "description" => desc} <- @invalid_specs do
test "#{name}: #{desc}" do
assert :error = TypeID.from_string(unquote(typeid))
end