eproxus / meck

A mocking library for Erlang
http://eproxus.github.io/meck
Apache License 2.0
811 stars 231 forks source link

yaws_api passthrough mocking ignores passthrough #112

Closed shkodrang closed 10 years ago

shkodrang commented 11 years ago

I am encountering a weird issue. With Yaws 1.93, mocking with 'passthrough' works as expected, but when I switch to Yaws 1.95 the created mock essentially loses access to unmocked funs.

Doing the following:

meck:new(yaws_api, [passthrough]), meck:expect(yaws_api, requesturl, fun() -> ok end).

and then calling another fun from yaws_api:

yaws_api:arg_req(Arg)

throws out a bunch of garbage, with the root cause at the end of it all:

* Reason for termination == * {'module could not be loaded', [{yaws_api,arg_req,[none],[]}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,576}]}, {shell,exprs,7,[{file,"shell.erl"},{line,668}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,623}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,608}]}]}

I would rule out user error in this case - the compiled yaws 1.95 is on ERL_LIBS and this seems to be happening across different Erlang/OTP versions (tested on R15B02 and R16B01).

eproxus commented 11 years ago

Could you paste the whole output?

eproxus commented 10 years ago

Closing because of inactivity. Please re-open if it is still an issue.