sntran
Doctest a delegated function
Hello,
I have a weird question today regarding doctest.
I have recently built an Erlang module, but use Elixir for testing.
I also have an Elixir module that basically uses defdelegate its function to the Erlang module.
I want to write doctests in Elixir module for those delegated functions (since I can’t do that in Erlang, and Elixir’s one is nice).
However, when I run mix test, I encounter the following warnings:
.....warning: GenNTTP.command/2 is undefined (module GenNTTP is not available or is yet to be defined)
(for doctest at) lib/gen_nntp.ex:104: GenNNTPTest."doctest GenNNTP.command/3 (1)"/1
warning: GenNTTP.connect/0 is undefined (module GenNTTP is not available or is yet to be defined)
(for doctest at) lib/gen_nntp.ex:103: GenNNTPTest."doctest GenNNTP.command/3 (1)"/1
Here is the small snippet for the Elixir module:
defmodule GenNNTP do
@doc """
Sends a command and receives server's response.
Both single and multi-line response are handled.
For commands that are followed by a multi-line data block, such as
"POST", place the block as the argument to `command/3` call.
## Examples
iex> {:ok, socket, _greeting} = GenNTTP.connect()
iex> GenNTTP.command(socket, "HELP")
:ok
"""
defdelegate command(socket, command, args \\ []), to: :gen_nntp
end
Is this expected? What can I do to overcome that?
Marked As Solved
sntran
Also Liked
dimitarvp
Last Post!
sntran
Popular in Questions
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I’m writing a test for one of the...
New
I have VueJS GUIs with the project generated using Webpack.
I have Elixir modules that will need to be used by the VueJS GUIs.
I forese...
New
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
Other popular topics
Hello, how can I check the Phoenix version ?
Thanks !
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









