Skip to content

Commit

Permalink
test: add test case for non existing JSON library
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Nov 27, 2024
1 parent 32d7a68 commit 3563566
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/protox/json_decode_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -706,5 +706,11 @@ defmodule Protox.JsonDecodeTest do
)
end
end

test "Failure: DummyJsonLibrary", %{} do
assert_raise Protox.JsonLibraryError, fn ->
Protox.json_decode!("", WithDummyJsonLibrary.Msg)
end
end
end
end
7 changes: 7 additions & 0 deletions test/support/messages.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ defmodule Protox.Messages do
namespace: WithJason,
json_library: Jason

use Protox,
files: [
"./test/samples/messages.proto"
],
namespace: WithDummyJsonLibrary,
json_library: DummyJsonLibrary

use Protox,
files: [
"./test/samples/messages.proto",
Expand Down

0 comments on commit 3563566

Please sign in to comment.