Current section
Files
Jump to
Current section
Files
lib/contract_impl/README.md
# Contract ImplThis support module helps with implementing contracts in tests. It ensures that the signature ofa method is right. This is done by creating dynamically a contract for all public functions.To use this helper, add to the contract of the module that you want to implement:```elixiruse ElixirTools.ContractImpl, module: MyApp.TestModule```Then, all mocked methods must be using `@impl true`.```elixir@override truedef my_method, do: :something```There is a caveat. At this moment, the specs themselves are not tested, as test files are exsfiles thus not dialyzed.## Example```elixiruse ElixirTools.ContractImpl, module: MyApp.TestModule@override truedef my_method, do: :something```