Skip to content

Commit

Permalink
Add test for unknown type
Browse files Browse the repository at this point in the history
  • Loading branch information
bmanuel authored and jonasschmidt committed May 31, 2019
1 parent 5c90c41 commit fd80867
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -10,7 +10,7 @@ Add the project to your Mix dependencies in `mix.exs`:

```elixir
defp deps do
[{:ex_json_schema, "~> 0.6.0"}]
[{:ex_json_schema, "~> 0.6.1"}]
end
```

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Expand Up @@ -4,7 +4,7 @@ defmodule ExJsonSchema.Mixfile do
def project do
[
app: :ex_json_schema,
version: "0.6.0",
version: "0.6.1",
elixir: "~> 1.3",
description:
"A JSON Schema validator with full support for the draft 4 specification and zero dependencies.",
Expand Down
9 changes: 9 additions & 0 deletions test/ex_json_schema/validator_test.exs
Expand Up @@ -201,6 +201,15 @@ defmodule ExJsonSchema.ValidatorTest do
)
end

test "validation errors for an unknown type" do
assert_validation_errors(
%{"type" => "string"},
{:foo, "bar"},
[{"Type mismatch. Expected String but got Unknown.", "#"}],
[%Error{error: %Error.Type{expected: ["string"], actual: "unknown"}, path: "#"}]
)
end

test "validation errors for invalid properties" do
assert_validation_errors(
%{
Expand Down

0 comments on commit fd80867

Please sign in to comment.