Skip to content

Commit 8bdd277

Browse files
committed
Improve ExUnit docs
1 parent 4fc85f3 commit 8bdd277

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lib/ex_unit/lib/ex_unit/case.ex

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,22 @@ defmodule ExUnit.Case do
168168
169169
* `:test_pid` - the PID of the testing process
170170
171-
* `:test_type` - the test type used when printing test results.
172-
It is set by ExUnit to `:test`, `:doctest` and so on, but is customizable.
171+
* `:test_type` - the test type used when printing test results. It can also
172+
be used for filtering. It is set by ExUnit to `:test`, `:doctest`, or
173+
the equivalent type given to `register_test/6`
173174
174175
* `:describe` - the describe block the test belongs to (if in a describe)
175176
176-
* `:describe_line` - the line the describe block begins on (if in a describe)
177+
* `:describe_line` - the line the describe block begins on (if in a describe).
178+
It can be used to run all tests in the describe block given by line
177179
178180
* `:doctest` - the module or the file being doctested (if a doctest)
179181
180-
* `:doctest_data` - additional metadata about doctests (if a doctest)
182+
* `:doctest_data` - additional metadata about doctests stored in a map,
183+
such as the `:end_line`, available for reflection purposes (if a doctest)
181184
182-
* `:doctest_line` - the line the doctest was defined (if a doctest)
185+
* `:doctest_line` - the line the doctest was defined (if a doctest).
186+
It can be used to run a doctest defined at the given source line
183187
184188
The following tags customize how tests behave:
185189
@@ -658,12 +662,11 @@ defmodule ExUnit.Case do
658662
end
659663

660664
@doc """
661-
Registers a function to run as part of this case.
665+
Registers a function to run as a test for this module.
662666
663-
This is used by third-party projects, like QuickCheck, to
664-
implement macros like `property/3` that works like `test`
665-
but instead defines a property. See `test/3` implementation
666-
for an example of invoking this function.
667+
This is used by third-party projects to implement macros like
668+
`property/3` that works like `test` but instead defines a property.
669+
See `test/3` implementation for an example of invoking this function.
667670
668671
The test type will be converted to a string and pluralized for
669672
display. You can use `ExUnit.plural_rule/2` to set a custom

lib/ex_unit/lib/ex_unit/filters.ex

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,8 @@ defmodule ExUnit.Filters do
192192
Tests are first excluded, then included, and then skipped (if any left).
193193
194194
If a `:skip` tag is found in `tags`, `{:skipped, message}` is returned if the test
195-
has been left after the `exclude` and `include` filters. Otherwise `{:exclude, message}`
196-
is returned.
197-
198-
The only exception to this rule is that `:skip` is found in the `include` filter,
199-
`:ok` is returned regardless of whether the test was excluded or not.
195+
remains after the `exclude` and `include` filters. However, if skipped tests are
196+
specifically included, then they will always run.
200197
201198
## Examples
202199

0 commit comments

Comments
 (0)