December 2019
Intermediate to advanced
248 pages
5h 34m
English
IEx is a great tool to sanity check our code as we go. We’re not going to run an exhaustive test; we’ll save that work for the test chapter (Chapter 5, Test Your Core ). We’ll use IEx to do a quick integration check to make sure our tools work together as we expect.
To do any meaningful integration test, we need a quiz but before we can build one we’ll need a template. Our quiz will use a single template for addition that generates questions of the form “x + y”. Type iex -S mix to open the codebase interactively:
| | $ iex -S mix |
| | iex(1)> alias Mastery.Core.{Template, Quiz, Response} |
| | [Mastery.Core.Template, Mastery.Core.Quiz, Mastery.Core.Response] |
| | iex(2)> generator = %{ left: [1, 2], right: [1, 2] } |
| | %{left: [1, 2], ... |
Read now
Unlock full access