Skip to content
mitchellwrosen edited this page Dec 3, 2014 · 3 revisions

Library module name 'foo' does not match calling module 'foo_meck_original'?

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...


I've mocked a helper function, yet when another function calls it, it's not mocked!!

See #120. The Erlang compiler generates a local function jump when compiling local functions. You must fully qualify the function call. For example, if you wish to mock bar, Rewrite

foo() -> 
    bar().

as

foo() -> 
    ?MODULE:bar().

Passthrough is not working.

See #14. Your module must be compiled with +debug_info.

Clone this wiki locally