Our application relies heavily on Cachex as our local caching solution.
Recently, while upgrading to Cachex 4.0, I noticed some changes in the Cachex.export/2 method. Specifically, the entry structure changed (the order of value and ttl was swapped), but this wasn't updated in the doctests and then discovered that the Cachex doctests weren't actually being used.
After adding doctest Cachex, I encountered a series of test failures. This PR is an attempt to fix the failing tests in the doctests. Here are the main points:
Assign a unique cache name based on the function name for each function's doctest. This prevents the ":already_started" error that occurs when using the same :my_cache name repeatedly.
Wrap example code using fictional module names like MyWarmer and MyHook in code blocks instead of using the iex> prefix.
I'm unsure if these changes will affect the readability of the generated documentation. Feel free to add comments or require modifications.
Our application relies heavily on
Cachex
as our local caching solution. Recently, while upgrading to Cachex 4.0, I noticed some changes in theCachex.export/2
method. Specifically, the entry structure changed (the order ofvalue
andttl
was swapped), but this wasn't updated in the doctests and then discovered that theCachex doctests
weren't actually being used.After adding
doctest Cachex
, I encountered a series of test failures. This PR is an attempt to fix the failing tests in the doctests. Here are the main points::my_cache
name repeatedly.MyWarmer
andMyHook
in code blocks instead of using theiex>
prefix.I'm unsure if these changes will affect the readability of the generated documentation. Feel free to add comments or require modifications.