Creating Comprehensive Test Coverage

Learn how to maximize coverage of a test file using setup block and module attributes.

We'll cover the following...

We’ve covered some of the very basics of testing and delved into a bit of test theory. To provide solid coverage of a file, we’ll need to build on that knowledge by pulling in some features of Elixir itself, as well as some optional features of ExUnit’s assertions. These skills will help us write maximum test coverage with minimal code and without trade-offs.

Using a setup block

Let’s jump back to where we left our Soggy Waffle test, SoggyWaffle.WeatherAPI.ResponseParserTest. The data we used in our test was ...