Writing Properties

In earlier chapters, you’ve seen that stateless properties all follow a pretty similar structure. The layout of code around files may vary from project to project, but overall, most test suites do share a separation between properties, generators, and helper functions. When it comes to stateful properties, there is far less of a standard: some people put properties in one file, models in another one, with helper functions and wrappers around the actual system in a third module. Other developers prefer to have everything in one spot.

In this book, we’ll stick to having the properties and the model in one file. As with basic properties, we can make use of the rebar3 plugin’s templating facilities to get the file we need within ...

Get Property-Based Testing with PropEr, Erlang, and Elixir now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.