Open randycoulman opened 3 years ago
@devonestes this seems to do the trick, would you consider accepting this PR?
The problem of the three failing doctests is unrelated to this particular issue - I think I see the problem there, will try to experiment with that in the next day or two.
@randycoulman I patched up that failing doctest issue in another PR, thanks for bringing it up!
@devonestes just a friendly ping, thank you!
I wasn't able to get this P/R to work when doing a fresh install. The error originally popped-up in CI when a fresh install was done. I can't track down a specific reason why but Assertions is being compiled before Absinthe is available. The Code.ensure_loaded?
check always returns false.
My workaround for now is a fork that removes the check.
@mattste
Marking the absinthe dependency as optional: true
in the mix.exs file helped fix the issue you've mentioned.
Currently using a fork that combines #27, #29 and the above change.
https://github.com/rizasal/assertions
Fixes #22 Replaces #24
From my reading of the docs and other research, it looks like
Code.ensure_loaded?
is a better way to check whether an optional dependency module exists or not. Details below. This PR preserves the intention of only including Absinthe-related code when Absinthe is present in the parent project. #24 was a temporary fix to disable the check as I understand it.This also fixes a formatting-related test failure in the doc tests for
assertions/absinthe.ex
. I still get 3 test failures in the doc tests (with Elixir 1.12.3), but I'm not sure what the problem is or how to fix them. The errors all happen informat_fields
with the message:Details:
Code.ensure_compiled
say:Code.ensure_loaded?
to check if a dependency is loaded or not.