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
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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
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
After calling mix ecto.create I get this error:
17:00:32.162 [error] GenServer #PID<0.412.0> terminating
** (Postgrex.Error) FATAL...
New
lets say i have a sample like
a = 20; b = 10;
if (a > b) do
{:ok, "a"}
end
if (a < b) do
{:ok, b}
end
if (a == b) do
{:ok, "equa...
New
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)?
Would
mix ecto.rollback -v 200809061...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
Hi everyone,
I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Other popular topics
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
15:22:35.803 [error] gen_event {lager_file_backend...
New
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set?
Thanks.
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: )
Hello all, this is ...
New
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
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
- #javascript
- #podcasts
- #code-sync
- #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
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









