Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Erm, yes this is why you mock it. I still fail to see the problem, here is an example how you mock a function: https://hexdocs.pm/mock/Mock.html

Inside `with_mock` code will only access mocked function. In case you want to call original function in some condition - you have `passthrough` available inside a new function which will call the original one. So what is the problem exactly?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: