jjh42 / mock

Mocking library for Elixir language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Public function call is not mocked

tim2CF opened this issue · comments

If we have module Foo, wanna to test function bar/1

def bar(data) do
  buzz(data, @someparam)
end

Where buzz/2 is also public function. We try to mock buzz/2 function with :passthrough option, but it not get mocked - original function is called. If we rewrite bar/1 function like this

def bar(data) do
  Foo.buzz(data, @someparam)
end

then buzz/2 function can be mocked. I think this behaviour should be fixed of documented.

This is a duplicate of #71.

We'll track this issue there.