Improve the ExUnit Infrastructure
Improving our setup is important, but it’s not enough. We can also improve our tests by stripping away ceremony and organizing our infrastructure. Things like common aliases and helper functions can quickly cut a couple of dozen characters in half. In a nutshell, these tiny bits of infrastructure will make it easier for our users to invoke the setups that improve our tests.
Normally, we’d add a few aliases to the top of a file and call it a day, but we’ll often have several different test files that need to use the same lines. Instead of tacking the same aliases to multiple files, we need a way to reuse these lines. Let’s pay a visit to the man behind the curtain to see how we’ll do that work.
When mix new ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access