samuelrivas/moka — pull request #18 by stwind (2013-07-29 02:52:54+00:00)
Title: FUNCT prepend moka module to call handler name

hi @samuelrivas , thank you for the inspiring work of moka.

I am currently using moka in one of my projects, and some use cases make me think that it may be better to name the call handler gen_server as a combination of the moka, mocked module and mock count.

Here is one my my use case:
I have a `foo.erl` and `bar.erl`, in both modules, they call `baz:something()`. And I want `baz:something()` behaves differently in `foo.erl` and `bar.erl`. So I do:
```erlang
Moka1 = moka:start(foo),
Moka2 = moka:start(bar),
moka:replace(Moka1, baz, something, fun() -> hoge end),
moka:replace(Moka2, baz, something, fun() -> piyo end),
```

This leads to same results of #16, since the call handler is name only after `baz`. So making it something like `foo_baz` and `bar_baz` should be the solution.