EUnit is a Lightweight Unit Testing Framework for Erlang
Questions tagged [eunit]
79 questions
0
votes
1 answer
Writing Meck testcases for gen_tcp function
Here is a simple IRC bot module written by Erlang:
IRC Bot
Could someone helps me write the testcase for the function connect and parse_line with MECK
connect(Host, Port) ->
{ok, Sock} = gen_tcp:connect(Host, Port, [{packet, line}]),
…
0
votes
1 answer
Correct way to use meck with foreach
I am using meck to test my gen_server mymodule. In particular I use meck to mock httpc following the instructions provided here.
Here is some code I extracted from my test:
do_some_tests_() ->
{foreach,
fun start/0,
fun stop/1,
[fun…

user601836
- 3,215
- 4
- 38
- 48
0
votes
1 answer
Eunit test won't wait for receive
Eunit won't wait for the receive, is there something special to eunit.
-module (test_account).
-include_lib ("eunit/include/eunit.hrl").
-compile (export_all).
login_test() ->
{ok, Socket} = gen_tcp:connect("localhost", 5678,
[binary,…

goofansu
- 2,277
- 3
- 30
- 48
0
votes
2 answers
What are EUnit test generators?
I have read the documentation about EUnit, but still I have no idea what is the purpose of test generators.
I have also read a nice tutorial here, but still no luck (a little too advanced).
I somewhat understand that a test generator function…

skanatek
- 5,133
- 3
- 47
- 75