eproxus/meck — pull request #78 by horkhe (2012-10-12 09:54:20+00:00)
Title: Introduce 'stub_all' option

For those who uses mocks in record-then-verify manner (and I am one of them :-)) it would be very convenient to create mocks that have stubs for all exported functions out-of-the-box. This feature introduces such capability. The default stubs allow everything as input arguments and return meck_stub. If in the scope of a test a more specific stub (expectation) is required, then the out-of-the-box stub (expectation) can be overridden by explicit call to meck:expect/3,4.

E.g. if there is a module m1 that exports function f/2 then:

meck:new(m1, [stub_all]),
?assertEquals(meck_stub, m1:f(blah, whatever)).