New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not meck ets module. #141
Comments
Can you replace the call to io:format(user, "MECK ERROR: ~p~n", [(catch meck:new(ets, [unstick]))]). I suspect this is because Ets has built-in functions (functions coded in C) that Meck cannot deal with in runtime. This is a limitation of Meck that unfortunately cannot be fixed (or at least it is very hard). |
MECK ERROR: {'EXIT', {{compile_forms, {error,[], [{"ets.erl", [{50,erl_lint, {deprecated_builtin_type, {tid,0}, {ets,tid}, "OTP 18.0"}}]}]}}, [{meck_proc,start, [ets,[unstick]], [{file,"src/meck_proc.erl"},{line,96}]}, {cluster_server_info,other_test,0, [{file,"src/cluster/cluster_server_info.erl"}, {line,61}]}, {eunit_test,'-mf_wrapper/2-fun-0-',2, [{file,"eunit_test.erl"},{line,266}]}, {eunit_test,run_testfun,1, [{file,"eunit_test.erl"},{line,65}]}, {eunit_proc,run_test,1,[{file,"eunit_proc.erl"},{line,506}]}, {eunit_proc,with_timeout,3, [{file,"eunit_proc.erl"},{line,331}]}, {eunit_proc,handle_test,2, [{file,"eunit_proc.erl"},{line,489}]}, {eunit_proc,tests_inorder,3, [{file,"eunit_proc.erl"},{line,431}]}]}} cluster_server_info: other_test (module 'cluster_server_info')...*skipped* undefined *unexpected termination of test process* ::{compile_forms,{error,[], [{"ets.erl", [{50,erl_lint, {deprecated_builtin_type,{...},...}}]}]}} |
Can reproduce on 17.5, but not on R16B03-1. One thing to note is that Meck is internally using 17> meck:new(ets, [unstick]).
ok
18> meck:expect(ets, i, 0, ok).
ok
19> ets:i().
=ERROR REPORT==== 13-May-2015::10:13:33 ===
** Generic server ets_meck terminating
** Last message in was {get_result_spec,i,[]}
** When Server state == {state,ets,[...]}
** Reason for termination ==
** {undef,[{ets,match_spec_run,[[{[]}],<<>>],[]},
{meck_args_matcher,match,2,
[{file,"src/meck_args_matcher.erl"},{line,85}]},
...]} If you want to mock away |
Closing because of inactivity. Please re-open if it is still an issue! |
my_test() ->
meck:new(ets, [unstick]),
meck:unload(ets),
ok.
m: my_test (module 'm')...skipped
undefined
unexpected termination of test process
::{compile_forms,{error,[],
[{"ets.erl",
[{50,erl_lint,
{deprecated_builtin_type,{...},...}}]}]}}
The text was updated successfully, but these errors were encountered: