mirror of
https://github.com/sloanelybutsurely/typeid-elixir.git
synced 2024-11-28 01:42:54 -05:00
0.1.0
This commit is contained in:
parent
db5e754d86
commit
5bf8b50e2d
3 changed files with 8 additions and 7 deletions
|
@ -153,7 +153,7 @@ defmodule TypeID do
|
|||
[suffix] ->
|
||||
from!("", suffix)
|
||||
|
||||
_ ->
|
||||
_ ->
|
||||
raise ArgumentError, "invalid TypeID"
|
||||
end
|
||||
end
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -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(),
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue