<div>From meck readme.md:</div><div>š</div><div>my_test() -></div><div>š š meck:new(my_library_module),</div><div>š š meck:expect(my_library_module, fib, fun(8) -> 21 end),</div><div>š š ?assertEqual(21, code_under_test:run(fib, 8)), % Uses my_library_module</div><div>š š ?assert(meck:validate(my_library_module)),</div><div>š š meck:unload(my_library_module).</div><div>š</div><div>23.07.2012, 09:15, "Roberto Ostinelli" <roberto@widetag.com>:</div><blockquote type="cite">dear all,<div>i'm trying to use the meck framework (<a href="https://github.com/eproxus/meck">https://github.com/eproxus/meck</a>) and i can't seem to find a way to test that a function gets called with the appropriate values.</div><div>for instance:</div><div>%%%%%%%%%%%%%%%%%%%%</div><div><div>-module(example).</div><div>-compile(export_all).</div><div>get_config() -></div><div>mocked:myfun("test.config").</div><div>-ifdef(TEST).</div><div>-include_lib("eunit/include/eunit.hrl").</div><div>get_config_test_() -></div><div>meck:new(mocked),</div><div>meck:expect(mocked, myfun, fun(Filename) -> ok end),</div><div>?_assertEqual(ok, get_config()),</div><div>?_assert(meck:validate(mocked)).</div><div>-endif.</div></div><div>%%%%%%%%%%%%%%%%%%%%</div><div>i'd like to test that mocked:myfun/1 gets called with "test.config" as parameter.</div><div>is this possible?</div><div>r.</div><p>_______________________________________________<br />erlang-questions mailing list<br /><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br /><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></p></blockquote>