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

You can write a using macro to automatically create a behaviour from specs in a module with https://hexdocs.pm/elixir/Module.html#spec_to_callback/2

It's been a minute but I've done it.

The behaviour/implementation setup reminds me of Java, especially when they're exactly the same.

I do recommend only using mox as far down as possible (only around libraries).

Hammox is Mox on steroids, check it out too.



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

Search: