Thanks for your help, Magnus. It works fine now.<br><br>Bob<br><br><div class="gmail_quote">2012/1/11 Magnus Klaar <span dir="ltr"><<a href="mailto:magnus.klaar@gmail.com">magnus.klaar@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi!<div><br></div><div>Comparing the output in the two posts, the first one returns 'a' from call_a() and the return value you specified using meck:expect/4 from the a() function, the second one shows that both call_a() and a() returns the value you specified.</div>
<div><br></div><div>If you want to return "result_from_mocked_a" from these functions you must invoke meck:expect/3 or /4 as:</div><div><br></div><div><span>meck:expect(meck_module_for_</span><span>test, a, 0, "result_from_mocked_a") or</span></div>
<div><font color="#222222" face="arial, sans-serif">meck:expect(meck_module_for_test, a, fun() -> "result_from_mocked_a" end )</font></div><div><font color="#222222" face="arial, sans-serif"><br>
</font></div><div><font color="#222222" face="arial, sans-serif">MVH Magnus</font></div><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 12:27 AM, Bohuslav Svancara <span dir="ltr"><<a href="mailto:bsvancara@gmail.com" target="_blank">bsvancara@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you, but it does not help.<br><br>---------- modified tested module:<div><br>-module(meck_module_for_test).<br>
-compile(export_all).<br>a() -> a.<br></div>call_a() -> <b>meck_module_for_test:a().</b> % changed line<br><br>
------- testing module "meck_test" is the same (se below)<br><br>Result:<br><br>1> meck_test:test().<br>Result of call_a: #Fun<meck_test.1.84433456><br>Result of a: #Fun<meck_test.1.84433456><br>
Valid: true<br>ok<br><br><br>Bob<br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br>