-
-
Notifications
You must be signed in to change notification settings - Fork 231
FAQ & Gotchas
eproxus edited this page Dec 3, 2014
·
3 revisions
See #59. Are you mocking a NIF? This error message comes from erlang:load_nif/2. A simple workaround is to rewrite
foo() ->
some_nif:some_func().
as
foo() ->
?MODULE:some_nif_some_func().
some_nif_some_func() ->
some_nif:some_func().
Note the ?MODULE:
above.
See #120. The Erlang compiler generates a local function jump when compiling local functions. You must export the function and use a fully qualified function call, i.e. prefix it with the module name. For example, if you wish to mock bar
, Rewrite
foo() ->
bar().
as
-export([bar/0]).
foo() ->
?MODULE:bar().
See #14. Your module must be compiled with debug_info
. Either add +debug_info
as a flag to erlc
or include the atom debug_info
when calling the Erlang compiler. Rebar automatically adds debug_info
when your application is compiled for testing.