You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -97,13 +97,16 @@ Why do we need this? TemperatureClient is always going to run the delegation log
97
97
98
98
Mockable works by using a `__before_compile__` macro to wrap each callback implementation in delegation logic. But it only does this if `:mockable` is configured for the module, thus it does not affect production code.
99
99
100
+
Mockable is not a mock framework. It works with the mock framework of your choice. It helps delegate function calls to mocks. If you are coming from OOP, Mockable serves a similar purpose to dependency injection in tests.
101
+
100
102
Features/Benefits:
101
103
102
104
- Zero boilerplate code
103
105
- Can be used with Exunit `async: true`
104
106
- Compatible with Mox/Hammox (and probably any other mocking library)
105
107
- Applies @callback as @spec on implementations to enable dialyzer checks
106
-
- Configurable with Application environment & process memory
107
108
- Completely compiles out in prod builds, not requiring even an `Application.get_env`, making it suitable for frequently called functions
108
109
- Behaviour and implementation defined in the same module for easy finding/reading
109
110
- Only overrides callbacks, other functions defined within the Mockable module are not delegated and can be called as normal
111
+
- IDE "navigate to definition" features work as expected
0 commit comments