sntran

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

sntran

Ah, please disregard. I have a typo in my module name :confused:

Also Liked

dimitarvp

dimitarvp

Rubber duck debugging strikes again! :heart:

Last Post!

sntran

sntran

Haha, silly me. I should have talked to the rubber duck in front of me.

Where Next?

Popular in Questions Top

New
Emily
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
Brian
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
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
openscript
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
gshaw
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
alice
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 Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Brian
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
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
nsuchy
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
sergio_101
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

We're in Beta

About us Mission Statement