Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions getting-started/mix-otp/introduction-to-mix.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@ defmodule KVTest do
end
```

It is important to note a couple things:
It is important to note a couple of things:

1. the test file is an Elixir script file (`.exs`). This is convenient because we don't need to compile test files before running them;

2. we define a test module named `KVTest`, use [`ExUnit.Case`](https://hexdocs.pm/ex_unit/ExUnit.Case.html) to inject the testing API and define a simple test using the `test/2` macro;
2. we define a test module named `KVTest`, in which we [`use ExUnit.Case`](https://hexdocs.pm/ex_unit/ExUnit.Case.html) to inject the testing API;

3. we use one of the injected macros, [`doctest/1`](https://hexdocs.pm/ex_unit/ExUnit.DocTest.html#doctest/2), to indicate that the `KV` module contains doctests (we will discuss those in a later chapter);

4. we use the [`test/2`](https://hexdocs.pm/ex_unit/ExUnit.Case.html#test/3) macro to define a simple test;

Mix also generated a file named `test/test_helper.exs` which is responsible for setting up the test framework:

Expand Down