Closed slfritchie closed 12 years ago
Thanks! The passthrough/1
function that already exists already allows you to call the original function. However, it had one limitation that it exited the expect-function when it was called. This is now changed in c336ce1a63997c14a27776d019afe715e0ae24e1 (based on the solution in your patch) where you can also use the return value inside the expect-function:
meck:expect(m, f, fun(N) -> M = meck:passthrough([N+1]), M / 2 end).
(This also closes the old #2 issue on the same topic).
Hi, sorry I didn't cook up a pull request the usual way. This is a really small change, but it's tremendously useful. When a module is defined in passthrough mode, when doing the following:
Using this new function, we could put the following into the first case clause:
or perhaps:
The small patch is:
Thanks for considering. I'm happily using this new function for nefarious testing purposes. The rest of Meck is quite useful, thanks for all of your work.