[erlang-questions] Fwd: meck

Motiejus Jakštys desired.mta@REDACTED
Fri Jul 27 09:32:18 CEST 2012


Forwarding to list.


---------- Forwarded message ----------
From: Motiejus Jakštys <desired.mta@REDACTED>
Date: Wed, Jul 25, 2012 at 9:31 AM
Subject: Re: [erlang-questions] meck
To: Roberto Ostinelli <roberto@REDACTED>


On Wed, Jul 25, 2012 at 7:30 AM, Roberto Ostinelli <roberto@REDACTED> wrote:
>
> can't i use this in generators?

You can, but another way. Generator must return a set of test cases.
For instance:

arith_test_() ->
    [
        ?_assertEqual(4, 2*2),
        ?_assertEqual(0, 1*0)
    ].

>From eunit manual[1]:
A function with a name ending in ..._test_() (note the final
underscore) is recognized by EUnit as a test generator function. Test
generators return a representation of a set of tests to be executed by
EUnit.

Stick with the simple test case instead (which ends with test()).
> the reason why i didn't include unload is because of this:
> https://github.com/eproxus/meck/issues/72

As said, try simple test case first.

[1]: http://www.erlang.org/doc/apps/eunit/chapter.html#EUnit_macros

--
Motiejus Jakštys


-- 
Motiejus Jakštys



More information about the erlang-questions mailing list