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
Ah, please disregard. I have a typo in my module name 
3
Also Liked
dimitarvp
Rubber duck debugging strikes again! 
1
Popular in Questions
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
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Hello all!
I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database.
Dep...
New
Hi,
is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
I would like to know what is the best IDE for elixir development?
New
I have a list say
x = ["23gh", "56kh", "97mh"]
I would like to pass each element to Val in each iteration.
Say, in iteration 1 -------...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
Other popular topics
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
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 t...
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 using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New







