msz / hammox

🏝 automated contract testing via type checking for Elixir functions and mocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`protect` all functions from behaviour by default

msz opened this issue · comments

`protect` all functions from behaviour by default

#54 added protect/1 for behaviour-implementation modules but not closing this just yet as it would be good to also add a protect/2 version for when the behaviour and implementation modules are different modules. cc @saneery if you'd like to tackle this too

Sure! you may assign the issue to me

@msz should we return exceptions then some function inside the implementation module doesn't have specs? Or decorate only those with specs?
The second seems is more reasonable to me

Often the implementation module will be much larger than a behaviour, and can actually implement several behaviours and still have its own functions. So I think if we are protecting with a specific behaviour, we should only look at callbacks from that behaviour.

Closed in #55.