Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Cont.) Make passthrough/1' and func/1 into a ret_spec`and func #91

Merged
merged 3 commits into from
Dec 21, 2012
Merged

(Cont.) Make passthrough/1' and func/1 into a ret_spec`and func #91

merged 3 commits into from
Dec 21, 2012

Conversation

horkhe
Copy link
Contributor

@horkhe horkhe commented Dec 13, 2012

This pull addresses the code inspection comments for 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_specs as simple as that: ret_specs 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.

horkhe and others added 3 commits November 7, 2012 10:28
Just like a value of any type except for function is treated as
if wrapped with meck_ret_spec:value/1, functions are now treated
as if wrapped with meck_ret_spec:exec/1.
@horkhe
Copy link
Contributor Author

horkhe commented Dec 19, 2012

@eproxus what your verdict will be?

@eproxus
Copy link
Owner

eproxus commented Dec 21, 2012

👍 Looks good!

eproxus added a commit that referenced this pull request Dec 21, 2012
(Cont.) Make `passthrough/1' and `func/1` into a `ret_spec`and func
@eproxus eproxus merged commit 8433cf2 into eproxus:develop Dec 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants