eproxus/meck — pull request #91 by horkhe (2012-12-13 14:15:17+00:00)
Title: (Cont.) Make `passthrough/1' and `func/1` into a `ret_spec`and func

This pull addresses the code inspection comments to the original #90 (The original pull request was not extendable since I created it not from a branch but from a particular commit).

@eproxus as we agreed functions are used as expectation bodies. But I left function `meck:exec/1` (previously suggested `meck:func/1` but renamed to better express the intention and align with `meck:raise/2`) so that if users would like to make their tests more expressive they can do that.

That makes general idea of **ret_spec**s as simple as that: **ret_spec**s are created by generator functions `meck:val/1`, `meck:raise/2`, `meck:exec/1`, `meck:passthrough/0`, `meck:seq/1`, `meck:loop/1`, but there are two shortcuts:
- values except for functions are treated as if wrapped with `meck:val/1`;
- functions are treated as if wrapped with `meck:exec/1`.