Skip to content

Commit

Permalink
Update version specific test, bump elixir version to 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanRublev committed Apr 29, 2024
1 parent 7fb8494 commit b3fd539
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- otp: 24.3.3
elixir: 1.13.4
- otp: 26.0
elixir: 1.15
elixir: 1.16
steps:
- uses: actions/checkout@v2
- uses: erlef/[email protected]
Expand Down
14 changes: 10 additions & 4 deletions test/domo_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,14 +1161,20 @@ a true value from the precondition.*defined for Account.t\(\) type./s, fn ->
compile_article_struct()
{:ok, _} = DomoMixTask.process_plan({:ok, []}, [])

field_type_str =
case ElixirVersion.version() do
[1, minor, _] when minor < 12 ->
":none | {:simple, %{author: <<_::_*8>>, published: <<_::_*8>>}} | {:detail, <<_::_*8>> | %{author: <<_::_*8>>, published_updated: :never | <<_::_*8>>}}"

[1, minor, _] when minor >= 12 ->
":none\n| {:simple, %{author: <<_::_*8>>, published: <<_::_*8>>}}\n| {:detail, <<_::_*8>> | %{author: <<_::_*8>>, published_updated: :never | <<_::_*8>>}}"
end

assert_raise ArgumentError,
"""
the following values should have types defined for fields of the Article struct:
* Invalid value {:detail, %{author: "John Smith", published_updated: {~D[2021-06-20], nil}}} \
for field :metadata of %Article{}. Expected the value matching the \
:none
| {:simple, %{author: <<_::_*8>>, published: <<_::_*8>>}}
| {:detail, <<_::_*8>> | %{author: <<_::_*8>>, published_updated: :never | <<_::_*8>>}} type.
for field :metadata of %Article{}. Expected the value matching the #{field_type_str} type.
Underlying errors:
- Expected the value matching the :none type.
- The element at index 0 has value :detail that is invalid.
Expand Down

0 comments on commit b3fd539

Please sign in to comment.