Test Your Boundary
This chapter has gone quickly. We built an integration test to work through the base mastery.exs API. We built only a single test, but it covered an end-to-end scenario with persistence enabled and a quiz. We even built in enough wrong and right answers to show that our mastery feature was working.
Next, we dove into specific persistence tests. We wrote tests to call our basic persistence function two different ways. Then we simulated an exception and followed that up with a brief test of our reporting function.
Along the way we experienced the impacts of the layering strategy we’ve used throughout this book. In particular, for each API we were able to isolate the concerns of our test to one sliver of complexity. After all, ...
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