Closed mattfreer closed 9 years ago
Thanks for this! Meck options are in fact provided by default but I had forgotten to state it in the documentation. Support for :passthrough
is really important though, maybe it would be cool to add a spec that formalises the behaviour. What do you think?
From what I can see the only Meck option that is passed through by default is :no_link
. So you do need to manually pass the :passthrough
option from your tests if you want to retain all other functions of the module in the mock. I'm happy to add a spec that demonstrates this if you like?
Oh, yeah, I wasn't saying that you didn't have to pass it in, I was just saying it would be great to have a test that shows that passing :passthrough
indeed makes retains all other original functions. The spec is just a way to formalise the contract so that future changes to the code don't break this behaviour.
Ok cool, yeah totally agree a test is necessary! I'll update the pull request tonight.
Thanks a lot!
@inf0rmer I've added some tests to formalise the behaviour, and updated the commit message.
Fantastic, this looks great! Thanks a lot.
When mocking a common requirement is for the mock to retain all other functions in the original module. The README has been updated to include information and an example of how this can be achieved.