Closed edgurgel closed 9 years ago
I like the idea in general. I think adding it to the code would make it a lot more complex (I might be wrong, and if you work on a PR I'd like to see the results).
I've also often thought about an API for Meck 2.0. This could go into such a draft.
The relevant places to start looking are:
https://github.com/eproxus/meck/blob/master/src/meck.erl#L225 https://github.com/eproxus/meck/blob/master/src/meck_expect.erl#L47 https://github.com/eproxus/meck/blob/master/src/meck_proc.erl#L226
Note that an Expect specification in Meck is something that is completely overwritten each time it is set (hence the way it works today). So, to change this you'd need some kind of state in the mock process with the Expect state so far, and what is to be added (in case the option is set) or overwritten.
Cool! Thanks for the tips! I will open a PR as soon as I have something working :+1:
So instead of writing this:
We could write this:
(This could be an option like:
meck:new(Mod, [:merge])
)Thoughts?
I could try to send a PR with this feature if someone could provide some guidance :)