May 2018
Intermediate to advanced
412 pages
9h 3m
English
We already used the ExUnit framework to write tests for our Issues tracker app. But that chapter only scratched the surface of Elixir testing. Let’s dig deeper.
When I document my functions, I like to include examples of the function being used—comments saying things such as, “Feed it these arguments, and you’ll get this result.” In the Elixir world, a common way to do this is to show the function being used in an IEx session.
Let’s look at an example from our Issues app. The TableFormatter formatter module defines a number of self-contained functions that we can document.
| | defmodule Issues.TableFormatter do |
| | |
| | import Enum, only: [ each: 2, map: 2, map_join: ... |
Read now
Unlock full access